From afdac88880922cbab8e998fee56ec969b1a03f2b Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 30 Jul 2024 09:40:00 -0700 Subject: [PATCH] Show version number on About button --- navpoint/run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/navpoint/run.py b/navpoint/run.py index d326a87..5d3e7d7 100755 --- a/navpoint/run.py +++ b/navpoint/run.py @@ -6,6 +6,9 @@ import navpoint.phone_server import navpoint.usb import navpoint.about +def _version(): + with open(navpoint.fix_path.fix_path("README.md")) as f: + return f.readline().split()[3] def run(): def _usb_clicked(): @@ -37,7 +40,7 @@ def run(): ttk.Separator(window, orient="horizontal").pack() ttk.Label(window, text="Navpoint is free and open-source.").pack() about_button = ttk.Button( - window, text="About Navpoint", command=navpoint.about.about + window, text="About Navpoint " + _version(), command=navpoint.about.about ) about_button.pack()