Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-imcflibs
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
imcf
python-imcflibs
Commits
68c7b76a
Commit
68c7b76a
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Add workaround for Jython issue reading ImageJ Prefs
parent
0aa41d09
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/imcflibs/imagej/prefs.py
+19
-0
19 additions, 0 deletions
src/imcflibs/imagej/prefs.py
with
19 additions
and
0 deletions
src/imcflibs/imagej/prefs.py
0 → 100644
+
19
−
0
View file @
68c7b76a
"""
Functions to work with ImageJ preferences.
"""
from
ij
import
Prefs
def
debug_mode
():
"""
Wrapper to check if
'
imcf.debugging
'
is enabled.
This is a workaround for a Jython issue in ImageJ with values that are
stored in the
"
IJ_Prefs.txt
"
file being cast to the wrong types and / or
values in Python. Callling Prefs.get() using a (Python) boolean as the
second parameter always leads to the return value
'
0.0
'
(Python type float),
no matter what is actually stored in the preferences. Doing the same in e.g.
Groovy behaves correctly.
Calling Prefs.get() as below with the second parameter being a string and
subsequently checking the string value leads to the expected result.
"""
debug
=
Prefs
.
get
(
"
imcf.debugging
"
,
"
false
"
)
return
debug
==
"
true
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment