def initialize(window_to_hide): helper.create_shortcut_first() helper.initialize_uid() new_session = web.get_session() if new_session is None: logging.error( "Couldn't create a session, some features might not work") print(f"created session {new_session}") try: is_admin = os.getuid() == 0 except AttributeError: is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 if is_admin: logging.info("Running with admin privileges") try: helper.auto_upgrade() except Exception: logging.error(traceback.format_exc()) if not config.get("debug", False) and check_window_name( win32gui.GetWindowText(window_to_hide)): win32gui.ShowWindow(window_to_hide, win32con.SW_HIDE) helper.install_thread_excepthook() sys.excepthook = helper.unhandled_exception_logging helper.check_addon("ProvisionsChalutier") if config.get("debug", False): helper.check_addon("FooAddon")
def initialize(c: Config, window_to_hide): helper.create_shortcut_first(c) helper.initialize_uid(c) new_session = web.get_session(c) if new_session is None: logging.error( "Couldn't create a session, some features might not work") print(f"created session {new_session}") try: is_admin = os.getuid() == 0 except AttributeError: is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 if is_admin: logging.info("Running with admin privileges") try: helper.auto_upgrade() except Exception: pass if not c.get("debug", False): win32gui.ShowWindow(window_to_hide, win32con.SW_HIDE) helper.install_thread_excepthook() sys.excepthook = helper.unhandled_exception_logging helper.check_addon()
def initialize(window_to_hide): helper.create_shortcut_first() helper.initialize_uid() new_session = web.get_session() if new_session is None: logging.error( "Couldn't create a session, some features might not work") print(f"created session {new_session}") try: is_admin = os.getuid() == 0 except AttributeError: is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 if is_admin: logging.info("Running with admin privileges") try: if helper.upgrade_avail() and not config.get("dont_ask_update", False): cv, hv = helper.versions() update_now, dont_ask_update = update_dialog.start(cv, hv) if dont_ask_update: config.set("dont_ask_update", dont_ask_update) else: config.delete("dont_ask_update") if update_now: helper.auto_upgrade() except Exception: logging.error(traceback.format_exc()) if not config.get("debug", False) and check_window_name( win32gui.GetWindowText(window_to_hide)): win32gui.ShowWindow(window_to_hide, win32con.SW_HIDE) helper.install_thread_excepthook() sys.excepthook = helper.unhandled_exception_logging if not config.get("addoninstalled", 0) or helper.get_addonversion( chalutier[0]) < chalutier[2]: helper.install_addon(*chalutier) helper.install_addon(*lam2) helper.remove_addon( "ProvisionsChalutier") #TODO delete with fishy 0.4.6 helper.remove_addon("FooAddon") #TODO delete with fishy 0.4.6 config.set("addoninstalled", helper.get_addonversion(chalutier[0]))
def initialize(window_to_hide): Migration.migrate() helper.create_shortcut_first() new_session = web.get_session() if new_session is None: logging.error("Couldn't create a session, some features might not work") logging.debug(f"created session {new_session}") try: is_admin = os.getuid() == 0 except AttributeError: is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 if is_admin: logging.info("Running with admin privileges") if not config.get("debug", False) and check_window_name(win32gui.GetWindowText(window_to_hide)): win32gui.ShowWindow(window_to_hide, win32con.SW_HIDE) helper.install_thread_excepthook() sys.excepthook = helper.unhandled_exception_logging helper.install_required_addons()