Commit 26becb34 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline

eiger_flash: port to Conda gevent-1.3.5:

* FileObject mode must be 'r|w', must not be closed at end
parent 2ba2f223
......@@ -189,11 +189,9 @@ class EigerHalfModule:
self.xterm = None
self.in_flash_mode = None
self.con_out_task = None
self.con_pipe_os = None
self.con_pipe = None
self.log_file_name = None
self.log_file_os = None
self.log_file = None
if log_file_name:
base, ext = log_file_name, ''
......@@ -203,10 +201,6 @@ class EigerHalfModule:
self.log_file_name = '%s_%s%s' % (base, self.name, ext)
def __del__(self):
if self.log_file:
self.log_file.close()
self.log_file_os.close()
if self.nc:
self.nc.terminate()
......@@ -468,16 +462,16 @@ class EigerHalfModule:
self.log('Executing: %s' % ' '.join(xterm_cmd))
self.xterm = Popen(xterm_cmd)
self.con_pipe_os = open(self.con_pipe_name, 'at')
self.con_pipe = FileObject(self.con_pipe_os, 'at')
con_pipe_os = open(self.con_pipe_name, 'at')
self.con_pipe = FileObject(con_pipe_os, 'wt')
msg = '*** Output from %s console ***\n' % self.name
self.con_pipe.write(msg)
self.con_pipe.flush()
if self.log_file_name:
log_exists = os.path.exists(self.log_file_name)
self.log_file_os = open(self.log_file_name, 'at')
self.log_file = FileObject(self.log_file_os, 'at')
log_file_os = open(self.log_file_name, 'at')
self.log_file = FileObject(log_file_os, 'wt')
if log_exists:
self.log_file.write('\n')
self.log_file.write('Eiger flash - %s\n' % start_time)
......@@ -486,10 +480,7 @@ class EigerHalfModule:
def close_xterm(self):
if self.con_pipe:
self.con_pipe.close()
self.con_pipe = None
self.con_pipe_os.close()
self.con_pipe_os = None
if self.xterm:
self.xterm.terminate()
......
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