Skip to content

Commit 953c7e6

Browse files
committed
Refactor version handling in GUI and add build script
1 parent edc3819 commit 953c7e6

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

lancalc/gui.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,7 @@ def validate_ip_on_focus_out(self):
317317
# Valid IP - clear any previous errors
318318
self.ip_input.setStyleSheet("")
319319
# Update status to version if no special range
320-
try:
321-
import lancalc
322-
version = lancalc.__version__
323-
except Exception:
324-
version = "0.0.0"
325-
self.status_label.setText(f'<a href="{core.REPO_URL}">LanCalc {version}</a>')
320+
self.status_label.setText(f'<a href="{core.REPO_URL}">LanCalc {VERSION}</a>')
326321
self.status_label.setStyleSheet("")
327322
except Exception:
328323
# Invalid IP - show error
@@ -333,13 +328,7 @@ def validate_ip_on_focus_out(self):
333328
def clear_validation(self):
334329
"""Clear validation styling when focus is gained."""
335330
self.ip_input.setStyleSheet("")
336-
# Update status to version
337-
try:
338-
import lancalc
339-
version = lancalc.__version__
340-
except Exception:
341-
version = "0.0.0"
342-
self.status_label.setText(f'<a href="{core.REPO_URL}">LanCalc {version}</a>')
331+
self.status_label.setText(f'<a href="{core.REPO_URL}">LanCalc {VERSION}</a>')
343332
self.status_label.setStyleSheet("")
344333

345334
def check_clipboard(self):

0 commit comments

Comments
 (0)