def check_for_update(): if not paths.is_frozen(): return url = updater.find_update_url(application.update_url, application.version) if url is None: return new_path = os.path.join(paths.app_data_path(application.name), 'updates', 'update.zip') app_updater = updater.AutoUpdater(url, new_path, 'bootstrap.exe', app_path=paths.app_path(), postexecute=paths.executable_path(), finish_callback=update_complete) d = question_dialog( parent=application.main_frame, caption=_("Update %s") % application.name, message= _("An update for %s is available, would you like to download and install it now?" ) % application.name, style=wx.YES | wx.NO | wx.ICON_WARNING) if d != wx.ID_YES: return logging.debug("User denied the update request!") logging.debug("User requested %s update. Initialising update process." % application.name) app_updater.start_update()
def load_library(libname, cdll=False): if paths.is_frozen(): libfile = os.path.join(paths.embedded_data_path(), 'accessible_output2', 'lib', libname) else: libfile = os.path.join(paths.module_path(), 'lib', libname) if cdll: return ctypes.cdll[libfile] else: return ctypes.windll[libfile]
def get_locale_path(module=None): """ Args: module: (Default value = None) Returns: """ if not paths.is_frozen(): return os.path.join(os.path.split(module.__file__)[0], "locale") return os.path.join(paths.embedded_data_path(), "locale")
def check_for_update(): if not paths.is_frozen(): return url = updater.find_update_url(application.update_url, application.version) if url is None: return new_path = os.path.join(paths.app_data_path(application.name), 'updates', 'update.zip') app_updater = updater.AutoUpdater(url, new_path, 'bootstrap.exe', app_path=paths.app_path(), postexecute=paths.executable_path(), finish_callback=update_complete) d = question_dialog(parent=application.main_frame, caption=_("Update %s") % application.name, message=_("An update for %s is available, would you like to download and install it now?") % application.name, style=wx.YES|wx.NO|wx.ICON_WARNING) if d!= wx.ID_YES: return logging.debug("User denied the update request!") logging.debug("User requested %s update. Initialising update process." % application.name) app_updater.start_update()
def load_library(libname, cdll=False): if paths.is_frozen(): libfile = os.path.join(paths.embedded_data_path(), "accessible_output2", "lib", libname) else: libfile = os.path.join(paths.module_path(), "lib", libname) if not os.path.exists(libfile): _cxfreeze_libfile = os.path.join(paths.embedded_data_path(), "lib", "accessible_output2", "lib", libname) if os.path.exists(_cxfreeze_libfile): libfile = _cxfreeze_libfile if cdll: return ctypes.cdll[libfile] return ctypes.windll[libfile]
import os from platform_utils.paths import module_path, is_frozen, embedded_data_path if is_frozen(): x86_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x86') x64_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x64') else: x86_path = os.path.join(module_path(), '..', 'lib', 'x86') x64_path = os.path.join(module_path(), '..', 'lib', 'x64')
from platform_utils import paths import pickle import babel.core if paths.is_frozen(): import pytz pytz.resource_exists = lambda name: False with open(os.path.join(paths.embedded_data_path(), "babel", "global.dat"), "rb") as fp: babel.core._global_data = pickle.load(fp) import babel.localedata if paths.is_frozen(): babel.localedata._dirname = os.path.join(paths.embedded_data_path(), "locale-data")