change structure of filename for bug reports in Beremiz and
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 14 Jul 2017 18:26:20 +0300
changeset 1718 703ddaf48b00
parent 1717 a86deec92e08
child 1719 704c7036db85
change structure of filename for bug reports in Beremiz and
PLCOpenEditor so bug reports could be easily sorted by name
BeremizIDE.py
PLCOpenEditor.py
--- a/BeremizIDE.py	Wed Jul 05 13:11:45 2017 +0300
+++ b/BeremizIDE.py	Fri Jul 14 18:26:20 2017 +0300
@@ -1166,7 +1166,7 @@
         if ex not in ignored_exceptions:
             ignored_exceptions.append(ex)
             date = time.ctime()
-            bug_report_path = path + os.sep + "bug_report_" + date.replace(':', '-').replace(' ', '_') + ".txt"
+            bug_report_path = path + os.sep + "bug_report_" + time.strftime("%Y_%m_%d__%H-%M-%S") + ".txt"
             save_bug_report(e_type, e_value, e_traceback, bug_report_path, date)
             Display_Exception_Dialog(e_type, e_value, e_traceback, bug_report_path)
     #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args)
--- a/PLCOpenEditor.py	Wed Jul 05 13:11:45 2017 +0300
+++ b/PLCOpenEditor.py	Fri Jul 14 18:26:20 2017 +0300
@@ -485,7 +485,7 @@
                     if 'self' in exception_locals:
                         info['self'] = format_namespace(exception_locals['self'].__dict__)
 
-                output = open(path+os.sep+"bug_report_"+info['date'].replace(':','-').replace(' ','_')+".txt",'w')
+                output = open(path+os.sep+"bug_report_"+time.strftime("%Y_%m_%d__%H-%M-%S")+".txt",'w')
                 lst = info.keys()
                 lst.sort()
                 for a in lst: