diff --git a/__init__.py b/__init__.py index e71c84de91d7104bb97a4ff14e26140d6426c73b..fbe457ca23d162af7ad9d47f7914b3095271d694 100644 --- a/__init__.py +++ b/__init__.py @@ -33,9 +33,17 @@ # # # IMPORT --------------------------------------------------------------- +from .config import INFO, WARN, SEVR, DBUG, SPCE + import os as os 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 from matplotlib.pyplot import figure from matplotlib.pyplot import rc @@ -56,7 +64,6 @@ G_RAWDATAS = {'current': MyData()} # raw data Object _G_WINDOWS = [] # CONFIGURATION -------------------------------------------------------- -from .config import INFO, WARN, SEVR, DBUG, SPCE from .config import D_FIGNUM, D_FIGSIZE, D_REFORMAT, D_FORMATTED from .config import D_RAWDATA, D_INPUTARG from .config import D_IPATH diff --git a/__main__.py b/__main__.py index b3f2908c10c7d00507104cb517182ffc5828b6fd..d2fd3ee5f494a882766b160e8b6346c6ef17fe75 100644 --- a/__main__.py +++ b/__main__.py @@ -33,7 +33,7 @@ # IMPORT --------------------------------------------------------------- from . import INFO, SPCE, DBUG from . import myTest, testList -from . import __dict__ +from .test import __dict__ as availTests import sys import getopt @@ -76,8 +76,8 @@ for opt, arg in opts: tests = arg.split(', ') testList = [] for test in tests: - if test in __dict__.keys(): - testList.append(__dict__[test]) + if test in availTests.keys(): + testList.append(availTests[test]) if len(testList) == 0: print(" > sevr-: you need to give valid tests to be tested.") diff --git a/myAxes.py b/myAxes.py index 291dc1eb63547ea9194db98dd2e01597c5987438..1a2a05471ed54af76b09ac720fb666f9aa6088fa 100644 --- a/myAxes.py +++ b/myAxes.py @@ -114,8 +114,19 @@ class MyAxes(Axes): # Because matplotlib.axes.update expect kwargs and not **kwargs ... (stupid!!) if args: # catch matplotlib kwargs 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 # 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}) +