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