Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fsleyes
fsleyes-props
Commits
881f1afc
Commit
881f1afc
authored
Mar 09, 2021
by
Paul McCarthy
🚵
Browse files
MNT: Remove dependency on six
parent
013b252e
Changes
8
Hide whitespace changes
Inline
Side-by-side
fsleyes_props/build.py
View file @
881f1afc
...
...
@@ -115,7 +115,6 @@ import weakref
import
copy
import
sys
import
six
import
wx
from
.
import
widgets
...
...
@@ -343,7 +342,7 @@ def _configureEventCallback(
# Each dependency is either the name of
# a property on the hasProps instance..
if
isinstance
(
dep
,
s
ix
.
string_types
):
if
isinstance
(
dep
,
s
tr
):
target
=
hasProps
propName
=
dep
...
...
@@ -438,7 +437,7 @@ def _createToggle(parent, viewItem, hasProps, propGui):
# Otherwise, use a BitmapToggleButton
else
:
if
isinstance
(
icon
,
s
ix
.
string_types
):
if
isinstance
(
icon
,
s
tr
):
icon
=
[
icon
]
for
i
in
range
(
len
(
icon
)):
...
...
fsleyes_props/callqueue.py
View file @
881f1afc
...
...
@@ -12,7 +12,7 @@ callback functions.
import
logging
import
six.moves.queue
as
queue
import
queue
import
fsl.utils.idle
as
idle
...
...
fsleyes_props/properties_types.py
View file @
881f1afc
...
...
@@ -35,8 +35,6 @@ import os.path as op
from
collections
import
abc
import
six
import
numpy
as
np
from
.
import
properties
as
props
...
...
@@ -284,7 +282,7 @@ class String(props.PropertyBase):
if
value
is
None
:
return
if
not
isinstance
(
value
,
s
ix
.
string_types
):
if
not
isinstance
(
value
,
s
tr
):
raise
ValueError
(
'Must be a string'
)
minlen
=
attributes
[
'minlen'
]
...
...
@@ -924,7 +922,7 @@ class ColourMap(props.PropertyBase):
``Colormap.name`` attribute. The match is case-insensitive.
"""
if
isinstance
(
value
,
s
ix
.
string_types
):
if
isinstance
(
value
,
s
tr
):
import
matplotlib.cm
as
mplcm
...
...
fsleyes_props/serialise.py
View file @
881f1afc
...
...
@@ -30,8 +30,6 @@ other property types for which it is needed, is provided by this module.
import
sys
import
logging
import
six
import
numpy
as
np
...
...
@@ -112,7 +110,7 @@ def _deserialise_Boolean(value, *a):
# Special case - a string containig 'false'
# (case insensitive) evaluates to False.
if
isinstance
(
value
,
s
ix
.
string_types
):
if
isinstance
(
value
,
s
tr
):
value
=
value
.
lower
()
if
value
==
'false'
:
value
=
''
...
...
fsleyes_props/trace.py
View file @
881f1afc
...
...
@@ -47,7 +47,7 @@ if log.getEffectiveLevel() == logging.DEBUG:
import
fsleyes_props
as
props
import
six.moves.queue
as
queue
import
queue
# The problem that I am addressing here is the
# fact that, when a property value listener is
...
...
fsleyes_props/widgets.py
View file @
881f1afc
...
...
@@ -100,8 +100,6 @@ import os.path as op
from
collections.abc
import
Iterable
import
six
import
wx
try
:
from
wx.combo
import
BitmapComboBox
...
...
@@ -547,8 +545,7 @@ def _makeColourMapBitmap(cmap):
# make a wx Bitmap from the colour data
colours
=
colours
.
ravel
(
order
=
'C'
)
if
six
.
PY2
:
bitmap
=
wx
.
BitmapFromBuffer
(
width
,
height
,
colours
)
else
:
bitmap
=
wx
.
Bitmap
.
FromBuffer
(
width
,
height
,
colours
)
bitmap
=
wx
.
Bitmap
.
FromBuffer
(
width
,
height
,
colours
)
return
bitmap
...
...
@@ -702,7 +699,7 @@ def _LinkBox(parent, hasProps, propObj, propVal, **kwargs):
propName
=
propObj
.
getLabel
(
hasProps
)
value
=
hasProps
.
isSyncedToParent
(
propName
)
linkBox
=
wx
.
ToggleButton
(
parent
,
label
=
six
.
u
(
'
\u21cb
'
)
,
label
=
'
\u21cb
'
,
style
=
wx
.
BU_EXACTFIT
)
linkBox
.
SetValue
(
value
)
...
...
fsleyes_props/widgets_boolean.py
View file @
881f1afc
...
...
@@ -12,8 +12,6 @@ the :mod:`widgets` module namespace. It is separated purely to keep the
import
wx
import
six
from
.
import
widgets
import
fsleyes_widgets.bitmapradio
as
bmpradio
import
fsleyes_widgets.bitmaptoggle
as
bmptoggle
...
...
@@ -60,7 +58,7 @@ def _Boolean(parent,
else
:
if
isinstance
(
icon
,
s
ix
.
string_types
):
if
isinstance
(
icon
,
s
tr
):
icon
=
[
icon
]
for
i
in
range
(
len
(
icon
)):
...
...
fsleyes_props/widgets_choice.py
View file @
881f1afc
...
...
@@ -13,8 +13,6 @@ import logging
import
wx
import
six
import
fsleyes_widgets.bitmapradio
as
bmpradio
from
.
import
widgets
...
...
@@ -192,7 +190,7 @@ def _Choice(parent,
# Load the image file for each choice
# if they have not already been loaded
for
cii
,
icon
in
enumerate
(
choiceIcons
):
if
isinstance
(
icon
,
s
ix
.
string_types
):
if
isinstance
(
icon
,
s
tr
):
choiceIcons
[
cii
]
=
wx
.
Bitmap
(
icon
,
type
=
wx
.
BITMAP_TYPE_PNG
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment