Skip to content

Commit 22f5bcb

Browse files
cclaussAetherUnbound
authored andcommitted
Resolve five undefined names found by flake8 (#112)
* 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 ``` * 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. * Undefined name: 'test' --> 'text' __NS_SPW__ is probably somehow related to https://www.openmicroscopy.org/Schemas/SPW/2015-01/SPW.xsd * Undefined name: NS_SPW --> self.ns['spw']
1 parent 5d92c8e commit 22f5bcb

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

bioformats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@
9595
import wx.py.PyCrust
9696

9797
wx.py.PyCrust.main()
98-
J.kill_vm()
98+
javabridge.kill_vm()

bioformats/formatreader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ def init_reader(self):
748748
je, "java/io/FileNotFoundException"):
749749
raise IOError(
750750
errno.ENOENT,
751-
"The file, \"%s\", does not exist." % path,
752-
path)
751+
"The file, \"%s\", does not exist." % self.path,
752+
self.path)
753753
e2 = IOError(
754754
errno.EINVAL, "Could not load the file as an image (see log for details)",
755755
self.path.encode('utf-8'))

bioformats/omexml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ def get_Description(self):
11611161
return get_text(description)
11621162

11631163
def set_Description(self, text):
1164-
make_text_node(self.node, NS_SPW, "Description", test)
1164+
make_text_node(self.node, self.ns['spw'], "Description", text)
11651165
Description = property(get_Description, set_Description)
11661166

11671167
def get_Well(self):

0 commit comments

Comments
 (0)