fixed conflict in base.py
This commit is contained in:
36
base.py
36
base.py
@@ -84,11 +84,11 @@ class BaseWindow(QMainWindow):
|
||||
#Causes QThread::wait: Thread tried to wait on itself
|
||||
#def __del__(self):
|
||||
# self.wait()
|
||||
|
||||
1
|
||||
def run(self):
|
||||
attach_files = []
|
||||
folder_name = self.folder_name
|
||||
|
||||
|
||||
date_str = self.parent.add_date_to_path(
|
||||
time_in_seconds=self.time_in_seconds,
|
||||
reanalysis_time_in_seconds=self.reanalysis_time)
|
||||
@@ -111,35 +111,49 @@ class BaseWindow(QMainWindow):
|
||||
idx) if idx > 0 else name_base
|
||||
save_dest = (folder_name + date_str + '_' + name +
|
||||
'.png')
|
||||
|
||||
|
||||
|
||||
if not os.path.exists(save_dest):
|
||||
if all_fig_data[canvas][idx] is not None:
|
||||
_dirname = os.path.dirname(save_dest)
|
||||
|
||||
if os.access(_dirname, os.W_OK):
|
||||
|
||||
all_fig_data[canvas][idx].savefig(save_dest)
|
||||
elif not write_message_fired:
|
||||
elif not write_message_fired:
|
||||
|
||||
_mess = ("Do not have write permission " +
|
||||
"for directory {0} from this " +
|
||||
"host {1}. Images not saved and " +
|
||||
"cannot be sent to elog").format(
|
||||
_dirname, os.uname()[1])
|
||||
|
||||
self.parent.trigger_log_message.emit(
|
||||
MsgSeverity.WARN.name, _pymodule,
|
||||
_line(), _mess, {})
|
||||
write_message_fired = True
|
||||
|
||||
attach_files.append(save_dest)
|
||||
|
||||
|
||||
if not write_message_fired:
|
||||
attach_files.append(save_dest)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
try:
|
||||
resultsSeq = self.settings.data["GUI"]["resultsSeq"]
|
||||
titleSeq = self.settings.data["GUI"]["subResultsTabTitle"]
|
||||
if self.all_data:
|
||||
fig_data = self.all_data['Figure data']
|
||||
for i, (nfig, name) in enumerate(zip(resultsSeq, titleSeq)):
|
||||
print(i, nfig, name, flush=True)
|
||||
print(fig_data, flush=True)
|
||||
extract_and_attach(i, nfig, name, fig_data)
|
||||
except KeyError as ex:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
try:
|
||||
resultsSeq = self.settings.data["GUI2"]["resultsSeq"]
|
||||
@@ -151,6 +165,8 @@ class BaseWindow(QMainWindow):
|
||||
except KeyError as ex:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
#Not so nice.. send a signal instead?
|
||||
if attach_files:
|
||||
self.parent.attach_files = attach_files
|
||||
@@ -490,9 +506,11 @@ class BaseWindow(QMainWindow):
|
||||
try:
|
||||
from src.analysis import AnalysisProcedure
|
||||
self.analysis_procedure = AnalysisProcedure(self)
|
||||
print("Base class has user supplied AnalysisProcedure class.",
|
||||
flush=True)
|
||||
except ImportError as e:
|
||||
print(("Base class without user supplied AnalysisProcedure class."
|
||||
+ " import Error:"), e)
|
||||
+ " import Error:"), e, flush=True)
|
||||
|
||||
##self.trigger_elog_entry.connect(self.receive_elog_notification)
|
||||
##self.trigger_hdf_save.connect(self.save_to_hdf)
|
||||
|
||||
Reference in New Issue
Block a user