fixed save data file overwrite bug
This commit is contained in:
+4
-4
@@ -375,9 +375,9 @@ class WndFixTarget(QWidget):
|
||||
#df.to_csv(filename, float_format="%.6f")
|
||||
#import numpy as np
|
||||
base,ext=os.path.splitext(filename)
|
||||
if not ext.lower():
|
||||
ext='json'
|
||||
filename=base+'.'+ext
|
||||
if ext=='':
|
||||
ext='.json'
|
||||
filename=base+ext
|
||||
try:
|
||||
wnd=app._mainWnd
|
||||
except AttributeError:
|
||||
@@ -387,7 +387,7 @@ class WndFixTarget(QWidget):
|
||||
grp=wnd._goTracked
|
||||
data=grp.childItems()
|
||||
|
||||
if ext.lower()=='json':
|
||||
if ext.lower()=='.json':
|
||||
with open(filename, 'w') as f:
|
||||
json.dump(data, f,cls=MyJsonEncoder, indent=2)#separators=(',', ':')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user