Ejemplo n.º 1
0
def check():
    if not get_config_value('update.enabled', True):
        return

    timestamp = _timestamp()
    last_check = _get_last_update_check() or timestamp
    if last_check + get_config_value('update.interval', 86400) > timestamp:
        return
    _set_last_update_check(timestamp)

    info('Checking for Black Mamba updates...')

    local_release = get_local_release()
    latest_release = _get_latest_release()

    if not latest_release:
        error('Failed to fetch latest release version info')
        return

    if local_release:
        if local_release['tag_name'] == latest_release['tag_name']:
            info('No updates available, you are up to date')
            return

        info('New version available, selfupdate.py will be executed')
        import blackmamba.ide.script as script
        if system.PYTHONISTA_BUNDLE_VERSION >= 311015:
            # 311015 introduced script queues, no need for delay
            delay = None
        else:
            delay = 0.5
        script.run_script('site-packages-3/blackmamba/script/selfupdate.py', delay=delay)

    else:
        info('Missing installed version info, you should use the installer')
Ejemplo n.º 2
0
 def run():
     script.run_script(path)
Ejemplo n.º 3
0
 def run(self, delay=None):
     script.run_script(self.script_name, delay=delay)
Ejemplo n.º 4
0
 def run_script(item, shift_enter):
     script.run_script(item.file_path, full_path=True, delay=1.0)