Commit 6ea3bc61 by devttys0

Fixed file open bug when attempting to scan a large number of files at once.

parent 1d50eaae
......@@ -74,7 +74,7 @@ class Plotter(Module):
self.window.opts['distance'] = self.VIEW_DISTANCE
if len(self.config.target_files) == 1:
self.window.setWindowTitle(self.config.target_files[0].name)
self.window.setWindowTitle(self.config.target_files[0])
def _print(self, message):
'''
......
......@@ -123,8 +123,9 @@ class General(Module):
sys.exit(0)
def reset(self):
for fp in self.target_files:
fp.reset()
pass
#for fp in self.target_files:
# fp.reset()
def __del__(self):
self._cleanup()
......@@ -133,9 +134,10 @@ class General(Module):
self._cleanup()
def _cleanup(self):
if hasattr(self, 'target_files'):
for fp in self.target_files:
fp.close()
pass
#if hasattr(self, 'target_files'):
# for fp in self.target_files:
# fp.close()
def _set_verbosity(self):
'''
......@@ -171,7 +173,9 @@ class General(Module):
if not self.subclass == io.FileIO or not os.path.isdir(tfile):
# Make sure we can open the target files
try:
self.target_files.append(self.open_file(tfile))
fp = self.open_file(tfile)
fp.close()
self.target_files.append(tfile)
except KeyboardInterrupt as e:
raise e
except Exception as e:
......
Markdown is supported
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