Commit | Line | Data |
---|---|---|
997664d8 FC |
1 | from ya2.utils.log import LogMgrBase |
2 | LogMgrBase.pre_init_logging() | |
3cc94ef6 | 3 | from sys import argv |
aad6ced2 FC |
4 | from ya2.p3d.gfx import P3dGfxMgr |
5 | if '--version' in argv: P3dGfxMgr.no_window() | |
8ee66edd | 6 | from os.path import exists |
3cc94ef6 | 7 | from traceback import print_exc |
3cc94ef6 | 8 | from p3d_appimage import AppImageBuilder |
997664d8 | 9 | from pmachines.app import Pmachines |
8ee66edd | 10 | |
aad6ced2 FC |
11 | |
12 | class Main: | |
13 | ||
14 | def __init__(self): | |
15 | self.__pmachines = Pmachines() | |
d6c157a0 | 16 | self.__appimage_builder = AppImageBuilder(None, 'pmachines') |
aad6ced2 FC |
17 | |
18 | def run(self): | |
d6c157a0 | 19 | if self.__pmachines.is_update_run: self.__appimage_builder.update() |
aad6ced2 FC |
20 | elif not self.__pmachines.is_version_run: self.__run_game() |
21 | ||
22 | def __run_game(self): | |
23 | try: self.__pmachines.run() | |
24 | except Exception: print_exc() | |
25 | ||
26 | ||
8ee66edd | 27 | if __name__ == '__main__' or exists('main.pyo'): |
aad6ced2 | 28 | Main().run() |