start.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. from sys import exit
  4. from controller.bms_login_ctl import BmsLoginControll
  5. from utils.globalvar import SD
  6. from utils.qt import QApplication, QCoreApplication, Qt, QStyleFactory
  7. import locale
  8. def bms_start():
  9. # 主版本号
  10. SD.MAJOR_VERSION_NUMBER = 1
  11. # 子版本号
  12. SD.MINOR_VERSION_NUMBER = 5
  13. # 修正版本号
  14. SD.REVISION_NUMBER = "0-build_test"
  15. local_tuple = locale.getdefaultlocale()
  16. if local_tuple[0].startswith("zh"):
  17. SD.SYSTEM_LANGUAGE = 0
  18. if local_tuple[0].startswith("en"):
  19. SD.SYSTEM_LANGUAGE = 1
  20. # 适配分辨率
  21. if hasattr(Qt, 'AA_EnableHighDpiScaling'):
  22. QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
  23. if hasattr(Qt, 'AA_UseHighDpiPixmaps'):
  24. QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
  25. SD.HIGH_DPI = 0
  26. else:
  27. SD.HIGH_DPI = 1
  28. main_connrtoller = BmsLoginControll()
  29. QApplication.setStyle(QStyleFactory.create("windows"))
  30. exit(main_connrtoller.run())
  31. if __name__ == "__main__":
  32. bms_start()