From c98f54709b456012968ee34bc40bee85792dd69b Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 27 Apr 2018 14:33:52 +0200 Subject: [PATCH 1/3] Always use PYMCA_DATA_DIR, if environment variable set --- PyMca5/PyMcaDataDir.py | 58 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/PyMca5/PyMcaDataDir.py b/PyMca5/PyMcaDataDir.py index c6c6f247f..edcb654c4 100644 --- a/PyMca5/PyMcaDataDir.py +++ b/PyMca5/PyMcaDataDir.py @@ -36,31 +36,46 @@ # This is to be filled by the setup PYMCA_DOC_DIR = 'DOC_DIR_FROM_SETUP' +PYMCA_DATA_DIR_ENV = os.getenv("PYMCA_DATA_DIR") +if PYMCA_DATA_DIR_ENV is not None: + PYMCA_DATA_DIR = PYMCA_DATA_DIR_ENV + if not os.path.exists(PYMCA_DATA_DIR): + raise IOError('%s directory set from environment not found' % \ + PYMCA_DATA_DIR) + else: + txt = "WARNING: Taking PYMCA_DATA_DIR from environment.\n" + txt += "Use it at your own risk." + print(txt) + + # this is used in build directory if not os.path.exists(PYMCA_DATA_DIR): tmp_dir = os.path.dirname(os.path.abspath(__file__)) old_tmp_dir = tmp_dir + "dummy" basename = "PyMcaData" - PYMCA_DATA_DIR = os.path.join(tmp_dir, "PyMca5", basename) - while (len(PYMCA_DATA_DIR) > 20) and (tmp_dir != old_tmp_dir): - if os.path.exists(PYMCA_DATA_DIR): + PYMCA_DATA_DIR_BUILD = os.path.join(tmp_dir, "PyMca5", basename) + while (len(PYMCA_DATA_DIR_BUILD) > 20) and (tmp_dir != old_tmp_dir): + if os.path.exists(PYMCA_DATA_DIR_BUILD): + PYMCA_DATA_DIR = PYMCA_DATA_DIR_BUILD break old_tmp_dir = tmp_dir tmp_dir = os.path.dirname(tmp_dir) - PYMCA_DATA_DIR = os.path.join(tmp_dir, "PyMca5", basename) + PYMCA_DATA_DIR_BUILD = os.path.join(tmp_dir, "PyMca5", basename) if not os.path.exists(PYMCA_DATA_DIR): - PYMCA_DATA_DIR = os.getenv("PYMCA_DATA_DIR") - if PYMCA_DATA_DIR is not None: - if not os.path.exists(PYMCA_DATA_DIR): - raise IOError('%s directory set from environent not found' % \ + raise IOError('%s directory not found' % PYMCA_DATA_DIR) + + +PYMCA_DOC_DIR_ENV = os.getenv("PYMCA_DOC_DIR") +if PYMCA_DOC_DIR_ENV is not None: + PYMCA_DOC_DIR = PYMCA_DOC_DIR_ENV + if not os.path.exists(PYMCA_DOC_DIR): + raise IOError('%s directory set from environent not found' % \ PYMCA_DATA_DIR) - else: - txt = "WARNING: Taking PYMCA_DATA_DIR from environement.\n" - txt += "Use it at your own risk." - print(txt) else: - raise IOError('%s directory not found' % basename) + txt = "WARNING: Taking PYMCA_DOC_DIR from environement.\n" + txt += "Use it at your own risk." + print(txt) # do the same for the directory containing HTML files if not os.path.exists(PYMCA_DOC_DIR): @@ -74,21 +89,6 @@ old_tmp_dir = tmp_dir tmp_dir = os.path.dirname(tmp_dir) PYMCA_DOC_DIR = os.path.join(tmp_dir, "PyMca5", basename) - -if not os.path.exists(PYMCA_DOC_DIR): - PYMCA_DOC_DIR = os.getenv("PYMCA_DOC_DIR") - if PYMCA_DOC_DIR is not None: - if not os.path.exists(PYMCA_DOC_DIR): - raise IOError('%s directory set from environent not found' % \ - PYMCA_DATA_DIR) - else: - txt = "WARNING: Taking PYMCA_DOC_DIR from environement.\n" - txt += "Use it at your own risk." - print(txt) - else: - # use the data dir as doc dir + if not os.path.exists(PYMCA_DOC_DIR): print("Setting PYMCA_DOC_DIR equal to PYMCA_DATA_DIR") PYMCA_DOC_DIR = PYMCA_DATA_DIR - -if not os.path.exists(PYMCA_DOC_DIR): - raise IOError('%s documentation directory not found' % basename) From 82b4fd4d3503e69976da5412cadc4261ee4ef82b Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 27 Apr 2018 14:41:56 +0200 Subject: [PATCH 2/3] debian 9 rules and chagelog --- package/debian9/changelog | 6 ++++++ package/debian9/rules | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package/debian9/changelog b/package/debian9/changelog index 5c8b521e4..bdc2a612c 100644 --- a/package/debian9/changelog +++ b/package/debian9/changelog @@ -1,3 +1,9 @@ +pymca (5.3.1-1) unstable; urgency=low + + * New release 5.3.1 + + -- Pierre Knobel Thu, 27 Apr 2018 10:01:17 +0200 + pymca (5.3.0-2) unstable; urgency=low * New release 5.3.0 diff --git a/package/debian9/rules b/package/debian9/rules index da697b2cc..11136053b 100644 --- a/package/debian9/rules +++ b/package/debian9/rules @@ -25,6 +25,10 @@ override_dh_clean: # remove the build documentation rm -rf doc/build +override_dh_auto_build: + dh_auto_build + python setup.py build build_doc + override_dh_installchangelogs: dh_installchangelogs changelog.txt @@ -58,10 +62,6 @@ override_dh_auto_test: PYBUILD_SYSTEM=custom \ PYBUILD_TEST_ARGS="cd {build_dir} && PYMCA_DATA_DIR=$(PYMCA_DATA_DIR_TEST) {interpreter} PyMca5/tests/TestAll.py" dh_auto_test -override_dh_sphinxdoc: -ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) - PYBUILD_SYSTEM=custom \ - PYBUILD_BUILD_ARGS="cd doc && PYTHONPATH={build_dir} PYMCA_DATA_DIR=$(PYMCA_DATA_DIR_TEST) http_proxy='127.0.0.1:9' {interpreter} -m sphinx -N -bhtml source build/html" dh_auto_build # HTML generator - dh_installdocs "doc/build/html" -p pymca-doc - dh_sphinxdoc -O--buildsystem=pybuild -endif +override_dh_installdocs: + dh_installdocs "build/sphinx/html" -p pymca-doc + dh_installdocs From 1f86321eacad73d4efca2e96223c9e1ee82095cb Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 27 Apr 2018 14:47:31 +0200 Subject: [PATCH 3/3] rst formatting error --- PyMca5/PyMcaCore/NexusTools.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PyMca5/PyMcaCore/NexusTools.py b/PyMca5/PyMcaCore/NexusTools.py index 28da21a98..17a11777a 100644 --- a/PyMca5/PyMcaCore/NexusTools.py +++ b/PyMca5/PyMcaCore/NexusTools.py @@ -426,8 +426,10 @@ def getInstrumentGroup(h5file, path): def getScannedPositioners(h5file, path): """ - Try to retrieve the positioners (aka. motors) that were moved + Try to retrieve the positioners (aka. motors) that were moved. + For that: + - Look for datasets present at measurement and positioners groups - Look for positioners with more than one single value - Look for datasets present at measurement and title