From 1e16f62cd60af3e9b6ca7bdedad1996afa358efc Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 25 Sep 2018 18:09:52 +0200 Subject: [PATCH 1/4] Typo: J.kill_vm() --> javabridge.kill_vm() [flake8](http://flake8.pycqa.org) testing of https://github.com/CellProfiler/python-bioformats on Python 2.7.14 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./bioformats/__init__.py:98:5: F821 undefined name 'J' J.kill_vm() ^ ./bioformats/formatreader.py:751:59: F821 undefined name 'path' "The file, \"%s\", does not exist." % path, ^ ./bioformats/formatreader.py:752:21: F821 undefined name 'path' path) ^ ./bioformats/omexml.py:1164:39: F821 undefined name 'NS_SPW' make_text_node(self.node, NS_SPW, "Description", test) ^ ./bioformats/omexml.py:1164:62: F821 undefined name 'test' make_text_node(self.node, NS_SPW, "Description", test) ^ 5 F821 undefined name 'J' 5 ``` --- bioformats/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bioformats/__init__.py b/bioformats/__init__.py index 84d1150..2c18b07 100644 --- a/bioformats/__init__.py +++ b/bioformats/__init__.py @@ -95,4 +95,4 @@ import wx.py.PyCrust wx.py.PyCrust.main() - J.kill_vm() + javabridge.kill_vm() From 702d5d21d2a1e6ea8fca0b4f7db0c550caeb5b29 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 25 Sep 2018 18:17:32 +0200 Subject: [PATCH 2/4] Undefined name: ' path' --> 'self.path' __path__ is an _undefined name_ in the context which will probably raise a __NameError__ at runtime instead of the desired Exception. --- bioformats/formatreader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bioformats/formatreader.py b/bioformats/formatreader.py index 9a18dbf..2d540d5 100644 --- a/bioformats/formatreader.py +++ b/bioformats/formatreader.py @@ -748,8 +748,8 @@ def init_reader(self): je, "java/io/FileNotFoundException"): raise IOError( errno.ENOENT, - "The file, \"%s\", does not exist." % path, - path) + "The file, \"%s\", does not exist." % self.path, + self.path) e2 = IOError( errno.EINVAL, "Could not load the file as an image (see log for details)", self.path.encode('utf-8')) From d05223ad236899096106747f7dd410c102a3db39 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 25 Sep 2018 18:28:20 +0200 Subject: [PATCH 3/4] Undefined name: 'test' --> 'text' __NS_SPW__ is probably somehow related to https://www.openmicroscopy.org/Schemas/SPW/2015-01/SPW.xsd --- bioformats/omexml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bioformats/omexml.py b/bioformats/omexml.py index 3a8535f..244550c 100644 --- a/bioformats/omexml.py +++ b/bioformats/omexml.py @@ -1161,7 +1161,7 @@ def get_Description(self): return get_text(description) def set_Description(self, text): - make_text_node(self.node, NS_SPW, "Description", test) + make_text_node(self.node, NS_SPW, "Description", text) Description = property(get_Description, set_Description) def get_Well(self): From 4516f15a6b27202a9fbbd35aedbfc33926e54ec0 Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 26 Sep 2018 07:30:37 +0200 Subject: [PATCH 4/4] Undefined name: NS_SPW --> self.ns['spw'] --- bioformats/omexml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bioformats/omexml.py b/bioformats/omexml.py index 244550c..34ac366 100644 --- a/bioformats/omexml.py +++ b/bioformats/omexml.py @@ -1161,7 +1161,7 @@ def get_Description(self): return get_text(description) def set_Description(self, text): - make_text_node(self.node, NS_SPW, "Description", text) + make_text_node(self.node, self.ns['spw'], "Description", text) Description = property(get_Description, set_Description) def get_Well(self):