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

Test the compatibility

Now compatible with python2.6

Also tested with matplotlib < 143 test203 fail
because in that version the function set_xlim was not
yet existing.

All version of matplotlib < 143 are not considered as stable
therefore not supported.

I add a message in __init__

I also corrected a bug I added in a former commit:
  I prevent myplotlib.__init__ from importing tests
  but just testList.

This prevented `python myplotlib --test <test name>` to work
because no tests were in myplotlib.__dict__

So I change the import from:
from . import __dict__
to
from .test import __dict__

Now `python myplotlib --test <test name>` works
parent 9315407b
......@@ -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
......
......@@ -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.")
......
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