Commit d780b035 authored by Yori Fournier's avatar Yori Fournier
Browse files

Merge branch 'compatibility-python2.6' into 'dev'

Compatibility python2.6

Closes #35

See merge request !37
parents 7415e5c8 bf696c84
...@@ -33,9 +33,17 @@ ...@@ -33,9 +33,17 @@
# #
# #
# IMPORT --------------------------------------------------------------- # IMPORT ---------------------------------------------------------------
from .config import INFO, WARN, SEVR, DBUG, SPCE
import os as os import os as os
import numpy as np import numpy as np
# Test mpl version:
from matplotlib import __version__ as mplvers
if int(mplvers.replace('.','')[:3]) < 143 :
print('\n\n' + WARN + 72*'=' + '\n' + SPCE + 'The matplotlib version you are using is not supported.\n' + SPCE + 'Most of myplotlib should work, but some stuff may not.\n' + SPCE + 'ex: expect an error with test203\n' + SPCE + 72*'=' + '\n\n')
# matplotlib # matplotlib
from matplotlib.pyplot import figure from matplotlib.pyplot import figure
from matplotlib.pyplot import rc from matplotlib.pyplot import rc
...@@ -56,7 +64,6 @@ G_RAWDATAS = {'current': MyData()} # raw data Object ...@@ -56,7 +64,6 @@ G_RAWDATAS = {'current': MyData()} # raw data Object
_G_WINDOWS = [] _G_WINDOWS = []
# CONFIGURATION -------------------------------------------------------- # CONFIGURATION --------------------------------------------------------
from .config import INFO, WARN, SEVR, DBUG, SPCE
from .config import D_FIGNUM, D_FIGSIZE, D_REFORMAT, D_FORMATTED from .config import D_FIGNUM, D_FIGSIZE, D_REFORMAT, D_FORMATTED
from .config import D_RAWDATA, D_INPUTARG from .config import D_RAWDATA, D_INPUTARG
from .config import D_IPATH from .config import D_IPATH
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
# IMPORT --------------------------------------------------------------- # IMPORT ---------------------------------------------------------------
from . import INFO, SPCE, DBUG from . import INFO, SPCE, DBUG
from . import myTest, testList from . import myTest, testList
from . import __dict__ from .test import __dict__ as availTests
import sys import sys
import getopt import getopt
...@@ -76,8 +76,8 @@ for opt, arg in opts: ...@@ -76,8 +76,8 @@ for opt, arg in opts:
tests = arg.split(', ') tests = arg.split(', ')
testList = [] testList = []
for test in tests: for test in tests:
if test in __dict__.keys(): if test in availTests.keys():
testList.append(__dict__[test]) testList.append(availTests[test])
if len(testList) == 0: if len(testList) == 0:
print(" > sevr-: you need to give valid tests to be tested.") print(" > sevr-: you need to give valid tests to be tested.")
......
...@@ -114,8 +114,19 @@ class MyAxes(Axes): ...@@ -114,8 +114,19 @@ class MyAxes(Axes):
# Because matplotlib.axes.update expect kwargs and not **kwargs ... (stupid!!) # Because matplotlib.axes.update expect kwargs and not **kwargs ... (stupid!!)
if args: # catch matplotlib kwargs if args: # catch matplotlib kwargs
kwargs = args[0] kwargs = args[0]
kw_for_axes = {key: value for (key, value) in args[0].items() if key not in self.keywords} # kw_for_axes = {key: value for (key, value) in args[0].items() if key not in self.keywords} # Not compatible with python2.6
kw_for_axes = {}
for (key, value) in args[0].items():
if key not in self.keywords:
kw_for_axes.update({key: value})
Axes.update(self, kw_for_axes) # update matplotlib.Axes Axes.update(self, kw_for_axes) # update matplotlib.Axes
# myplotlib update # myplotlib update
self.keywords.update({key: value for (key, value) in kwargs.items() if key in self.keywords}) # self.keywords.update({key: value for (key, value) in kwargs.items() if key in self.keywords}) # Not compatible with python2.6
for (key, value) in kwargs.items():
if key in self.keywords:
self.keywords.update({key: value})
Markdown is supported
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