From dd7b586ea013fe00801e9589dc8821179bd7809e Mon Sep 17 00:00:00 2001 From: "arda.aydin@ontrol.com.tr" Date: Wed, 12 Aug 2026 22:08:20 +0300 Subject: [PATCH] Drop testprogram/ from the repo, show version in dialog titles testprogram/ is local test data, not part of the tool: untracked and gitignored so it never comes back. verify.py now prints SKIP and exits 0 when the test pair is absent instead of blowing up. Adds config.NAME / config.VERSION (sab2sax 0.0.0.001). Every dialog title bar goes through config.title(), and the CLI prints the same line at startup, so it is clear which build produced a file. Co-Authored-By: Claude Opus 5 --- .gitignore | 1 + README.md | 14 +- config.py | 20 +- sab2sax.py | 1 + testprogram/test_normal.sax | 1266 --------------------------- testprogram/test_normal_sedonac.sab | Bin 7852 -> 0 bytes verify.py | 6 + 7 files changed, 33 insertions(+), 1275 deletions(-) delete mode 100644 testprogram/test_normal.sax delete mode 100644 testprogram/test_normal_sedonac.sab diff --git a/.gitignore b/.gitignore index 5724b71..2673c48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__/ *.pyc +testprogram/ *-sab2sax-*.sab *-sab2sax-*.sax diff --git a/README.md b/README.md index 131a612..50d862c 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,20 @@ set the key by hand instead. `python config.py` prints the resolved home, prompting if it isn't set yet. +## Version + +`config.NAME` / `config.VERSION` — currently `sab2sax 0.0.0.001`. Every dialog title bar reads +`sab2sax 0.0.0.001 - Select the .sax or .sab application file to convert`, and the CLI prints the +same line when it starts, so it is obvious which build produced a file. Bump it in +[config.py](config.py) and both follow. + ## Verify python verify.py [sedona_home] -Without an argument the home comes from `system.properties`. Three checks, both against the -checked-in pair in `testprogram/`: +Without an argument the home comes from `system.properties`. Three checks, run against a +`test_normal.sax` / `test_normal_sedonac.sab` pair in `testprogram/`. That folder is **not** in the +repo (gitignored) — drop the pair in yourself, otherwise verify prints `SKIP` and exits 0: test_normal.sax -> sab vs test_normal_sedonac.sab test_normal_sedonac.sab -> sax vs test_normal.sax @@ -84,7 +92,7 @@ under. config.py system.properties read/write, folder + file choosers verify.py regression check against sedonac's output, both directions system.properties sedona.home - testprogram/ test_normal.sax and the sedonac .sab to match it against + testprogram/ local only, gitignored: test apps to run verify.py against ## Format diff --git a/config.py b/config.py index 1cd8cd3..6706e5e 100644 --- a/config.py +++ b/config.py @@ -14,11 +14,19 @@ chooser is shown and the answer is written back to `system.properties`. """ import os, sys +NAME = "sab2sax" +VERSION = "0.0.0.001" + HERE = os.path.dirname(os.path.abspath(__file__)) PROPS = os.path.join(HERE, "system.properties") KEY = "sedona.home" +def title(text): + """Every dialog carries the program name and version in its title bar.""" + return "%s %s - %s" % (NAME, VERSION, text) + + # ---------- .properties ---------- def _unescape(v): """Collapse `\\\\` to `\\`; leave any other backslash alone. @@ -82,36 +90,36 @@ def _tk(): return None -def ask_directory(title, initial=None): +def ask_directory(text, initial=None): root = _tk() if root is None: return None try: from tkinter import filedialog - return filedialog.askdirectory(title=title, initialdir=initial or HERE) or None + return filedialog.askdirectory(title=title(text), initialdir=initial or HERE) or None finally: root.destroy() -def ask_open_file(title, filetypes, initial=None): +def ask_open_file(text, filetypes, initial=None): root = _tk() if root is None: return None try: from tkinter import filedialog - return filedialog.askopenfilename(title=title, filetypes=filetypes, + return filedialog.askopenfilename(title=title(text), filetypes=filetypes, initialdir=initial or HERE) or None finally: root.destroy() -def ask_save_file(title, filetypes, defaultextension, initialfile=None, initial=None): +def ask_save_file(text, filetypes, defaultextension, initialfile=None, initial=None): root = _tk() if root is None: return None try: from tkinter import filedialog - return filedialog.asksaveasfilename(title=title, filetypes=filetypes, + return filedialog.asksaveasfilename(title=title(text), filetypes=filetypes, defaultextension=defaultextension, initialfile=initialfile, initialdir=initial or HERE) or None diff --git a/sab2sax.py b/sab2sax.py index c5ab1cc..bbdf2fb 100644 --- a/sab2sax.py +++ b/sab2sax.py @@ -30,6 +30,7 @@ def convert(in_path, out_path=None, home=None): def main(argv): + print("%s %s" % (config.NAME, config.VERSION)) home = config.get_sedona_home() in_path = argv[1] if len(argv) > 1 else config.choose_input_file() diff --git a/testprogram/test_normal.sax b/testprogram/test_normal.sax deleted file mode 100644 index c25127c..0000000 --- a/testprogram/test_normal.sax +++ /dev/null @@ -1,1266 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testprogram/test_normal_sedonac.sab b/testprogram/test_normal_sedonac.sab deleted file mode 100644 index 8f5a9492baf692cdca09021919d9967991b10aea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7852 zcmd5>d2m$amj8YCcHeZTw=7LVcm$&F`6Pe{jXcn+1D(V+Q6M1+!3Du4X`r!_j@=y) zTpkK)O(7~OuBGBqHSQa@?}FPa=S`Kn&wZ`=^VL*M)ztjc^E=&@czSOB$KtEMg!;-u zXsYcv?4TJ1sXF9s*-y##?{=w0{d}dp=Z#Yvd#v{%V+WVyX*elf%=QN&6_#Nv%fLEC}oSeOdi)PJZq#> zxELqz-1F7;>_+%De)JFcnZc=*7*#4z`~eD9M@RdHr9dpz-?O2ot9#Xkg-con7LkYl z18_WvFKtL%d8%79XaZkQXUDRj_Y=}tPyF$4bLQbEtT>fwzFOTz! z2c<%CGTx-7HdmYZ#z8*tCzlrc?^XX|(k!yrgw22R-!1Ny zItrv-=UgZ8??L{UjHwo&orcJ-BLRK2U%Ly-b~*RIMrG{ZbEV$pJbwjO$wb{4m#HKn z^ue#D$r||(%M1U%YtpZu{;(3fqRiPD$qI z^|aIssG9x&hHO{?z1GZshgYM*vQl#v0MS$_mpQSkRL+cS9LtOC227t>>+{*DsW&76 zMO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E8PD^SUBlU^$q0$;8W~3a>DMxp9Tqw;*QWHO2q4!RuUw5Z+KY z!NQx0=l3|mScPzu|IK9KEye$`z}xgRgm>7PT72pAz#H!=slg8el3gDKWGy}p;3Es4 onE2SjXQpJ@*8zNO;Tr=x4SZu_uEiG!*eL!Gz*GZ22Kd7KFDtj?4*&oF diff --git a/verify.py b/verify.py index 3708130..c7c19f1 100644 --- a/verify.py +++ b/verify.py @@ -99,6 +99,12 @@ if __name__ == "__main__": print("sedona home: %s" % HOME) saxf = os.path.join(TESTS, "test_normal.sax") sabf = os.path.join(TESTS, "test_normal_sedonac.sab") + missing = [f for f in (saxf, sabf) if not os.path.isfile(f)] + if missing: + # testprogram/ is deliberately not in the repo -- put the pair back to run this + print(" SKIP no test files: %s" % ", ".join(os.path.basename(f) for f in missing)) + sys.exit(0) + ok = check_encode(saxf, sabf) ok &= check_decode(sabf, saxf) ok &= check_round_trip(sabf)