File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66from capture_api import CaptureAPI
77from ui import MainWindow
8+ from version import __version__
89
910logging .basicConfig (level = logging .DEBUG )
1011
12+
1113def main () -> int :
1214 app = QApplication (sys .argv )
1315
@@ -28,4 +30,8 @@ def main() -> int:
2830
2931
3032if __name__ == "__main__" :
33+ if "--version" in sys .argv :
34+ print (__version__ )
35+ sys .exit (0 )
36+
3137 sys .exit (main ())
Original file line number Diff line number Diff line change 2121from configs import LOCK_INTERVAL , PRESS_ENTER , configs
2222from detect_code import detect_code
2323from ui .widgets import DetectionIndicator , FrameLabel , TimerLineEditWidget
24+ from version import __version__
2425
2526from .beep_sound import play_beep
2627
@@ -38,7 +39,7 @@ def __init__(self) -> None:
3839 self ._capture_option_change_callback : Callable [[str ], None ] | None = None
3940 self ._mouse_pressed : QPoint | None = None
4041
41- self .setWindowTitle ("Paste Bar Code" )
42+ self .setWindowTitle (f "Paste Bar Code - v { __version__ } " )
4243
4344 win_geo = configs ["window_geo" ]
4445 if win_geo == "center" :
Original file line number Diff line number Diff line change 1+ from importlib .metadata import PackageNotFoundError , version
2+
3+ try :
4+ __version__ = version ("paste-bar-code" )
5+ except PackageNotFoundError :
6+ __version__ = "0.0.0"
You can’t perform that action at this time.
0 commit comments