Export XLS: add timestamp to default filename
The save dialog now suggests e.g. normal_kits_20260911_143200.xlsx so successive exports never collide. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it.
|
|||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
VERSION = "0.0.0.070"
|
VERSION = "0.0.0.071"
|
||||||
PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties")
|
PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties")
|
||||||
DEFAULT_GRID_SIZE = 10
|
DEFAULT_GRID_SIZE = 10
|
||||||
DEFAULT_ADD_TIMESTAMP = True
|
DEFAULT_ADD_TIMESTAMP = True
|
||||||
|
|||||||
+3
-1
@@ -16,6 +16,7 @@ declared starts unticked, and ticking it adds it at its newest build.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from datetime import datetime
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import filedialog, messagebox, ttk
|
from tkinter import filedialog, messagebox, ttk
|
||||||
|
|
||||||
@@ -301,7 +302,8 @@ class KitsPanel:
|
|||||||
default_name = ""
|
default_name = ""
|
||||||
if app_state.current_file_path:
|
if app_state.current_file_path:
|
||||||
base = os.path.splitext(os.path.basename(app_state.current_file_path))[0]
|
base = os.path.splitext(os.path.basename(app_state.current_file_path))[0]
|
||||||
default_name = f"{base}_kits.xlsx"
|
stamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
|
default_name = f"{base}_kits_{stamp}.xlsx"
|
||||||
|
|
||||||
path = filedialog.asksaveasfilename(
|
path = filedialog.asksaveasfilename(
|
||||||
title="Export Kit Table",
|
title="Export Kit Table",
|
||||||
|
|||||||
Reference in New Issue
Block a user