Commit a21cccdd authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'mnt/six' into 'master'

Mnt/six

See merge request fsl/fsleyes/props!43
parents 013b252e bb7b134b
......@@ -13,6 +13,7 @@ Changed
* The ``fsleyes-props`` API documentation is now hosted at
https://open.win.ox.ac.uk/pages/fsl/fsleyes/props/
* ``fsleyes-props`` is now tested against Python 3.7, 3.8, and 3.9.
* Removed ``six`` as a dependency.
1.7.0 (Tuesday May 26th 2020)
......
......@@ -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, six.string_types):
if isinstance(dep, str):
target = hasProps
propName = dep
......@@ -438,7 +437,7 @@ def _createToggle(parent, viewItem, hasProps, propGui):
# Otherwise, use a BitmapToggleButton
else:
if isinstance(icon, six.string_types):
if isinstance(icon, str):
icon = [icon]
for i in range(len(icon)):
......
......@@ -12,7 +12,7 @@ callback functions.
import logging
import six.moves.queue as queue
import queue
import fsl.utils.idle as idle
......
......@@ -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, six.string_types):
if not isinstance(value, str):
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, six.string_types):
if isinstance(value, str):
import matplotlib.cm as mplcm
......
......@@ -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, six.string_types):
if isinstance(value, str):
value = value.lower()
if value == 'false':
value = ''
......
......@@ -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
......
......@@ -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)
......
......@@ -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, six.string_types):
if isinstance(icon, str):
icon = [icon]
for i in range(len(icon)):
......
......@@ -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, six.string_types):
if isinstance(icon, str):
choiceIcons[cii] = wx.Bitmap(icon,
type=wx.BITMAP_TYPE_PNG)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment