Ejemplo n.º 1
0
    def __init__(self, config_class):
        self.init_time = time.time()
        self.app = rumps.App(Const.app_name, quit_button=None)
        self.app_shell = init_app_shell()
        if self.app_shell.check():
            Log.init_app(keep_log=self.is_restart)

        Log.append('app_init', 'Info', 'version: %s' % Const.version, 'args: %s' % sys.argv,
                   system_api.get_system_version())
        Log.append('app_shell', 'Info', {
            'shell_class': self.app_shell.__class__.__name__,
            'runtime_dir': self.app_shell.get_runtime_dir(),
            'app_path': self.app_shell.get_app_path(),
            'is_restart': self.is_restart,
            'restart_data': self.restart_data,
        })

        self.config = config_class()
        self.config.load()

        self.lang = load_language(self.config.language)  # type: English

        self.menu = {}
        self.menu_check_update = None  # type: rumps.MenuItem

        self.is_admin = system_api.check_admin()
        if not self.is_restart:
            threading.Thread(target=self.check_update, args=(False,)).start()
Ejemplo n.º 2
0
import sys

from app import Application
from app.util import pyinstaller
from app.util.log import Log

if getattr(sys, 'frozen', False):
    # is run at pyinstaller
    pyinstaller.fix_encoding_in_pyinstaller()
    Log.init_app()

app = Application(sys.argv)

try:
    status = app.run()
    sys.exit(status)
except SystemExit:
    pass
except:
    app.callback_exception()