fixed save data file overwrite bug

This commit is contained in:
John Henry Beale
2026-05-15 13:42:29 +02:00
parent fef8250581
commit 0aa124b912
+4 -4
View File
@@ -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: