start.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @文件 :start.py
  5. @时间 :2023/11/26 15:57:45
  6. @作者 :樊春春
  7. @版本 :1.0
  8. @邮箱 :[email protected]
  9. @说明 :
  10. '''
  11. from sys import exit
  12. from controller.bms_login_ctl import BmsLoginControll
  13. from utils.globalvar import SD
  14. from utils.qt import QApplication, QCoreApplication, Qt, QStyleFactory
  15. import locale
  16. def bms_start():
  17. # 主版本号
  18. SD.MAJOR_VERSION_NUMBER = 1
  19. # 子版本号
  20. SD.MINOR_VERSION_NUMBER = 3
  21. # 修正版本号
  22. SD.REVISION_NUMBER = "0-build_test"
  23. local_tuple = locale.getdefaultlocale()
  24. if local_tuple[0].startswith("zh"):
  25. SD.SYSTEM_LANGUAGE = 0
  26. if local_tuple[0].startswith("en"):
  27. SD.SYSTEM_LANGUAGE = 1
  28. # 适配分辨率
  29. if hasattr(Qt, 'AA_EnableHighDpiScaling'):
  30. QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
  31. if hasattr(Qt, 'AA_UseHighDpiPixmaps'):
  32. QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
  33. SD.HIGH_DPI = 0
  34. else:
  35. SD.HIGH_DPI = 1
  36. main_connrtoller = BmsLoginControll()
  37. QApplication.setStyle(QStyleFactory.create("windows"))
  38. exit(main_connrtoller.run())
  39. if __name__ == "__main__":
  40. bms_start()