Exemplo n.º 1
0
def _check_for_updates():
    if _check_connection():
        logger.info('Checking for updates...')

        for repo in updater.get_all_extension_repos():
            if updater.has_pending_updates(repo):
                return True
    else:
        logger.warning('No internet access detected. '
                       'Skipping check for updates.')
        return False
Exemplo n.º 2
0
def _check_for_updates():
    if _check_connection():
        logger.info('Checking for updates...')

        for repo in updater.get_all_extension_repos():
            if updater.has_pending_updates(repo):
                logger.info('Updates are available for {}...'.format(
                    repo.name))
                return True
            else:
                logger.info('{} is up-to-date...'.format(repo.name))
    else:
        logger.warning('No internet access detected. '
                       'Skipping check for updates.')
        return False
Exemplo n.º 3
0

# noinspection PyUnusedLocal
def __selfinit__(script_cmp, ui_button_cmp, __rvt__):
    try:
        has_update_icon = script_cmp.get_bundle_file('icon_hasupdates.png')
        if user_config.core.checkupdates and _check_for_updates():
            ui_button_cmp.set_icon(has_update_icon, icon_size=ICON_LARGE)
    except:
        return


if __name__ == '__main__':
    # collect a list of all repos to be updates
    if _check_connection():
        repo_info_list = updater.get_all_extension_repos()
        logger.debug('List of repos to be updated: {}'.format(repo_info_list))

        for repo_info in repo_info_list:
            # update one by one
            logger.debug('Updating repo: {}'.format(repo_info.directory))
            try:
                upped_repo_info = updater.update_pyrevit(repo_info)
                logger.info(
                    ':inbox_tray: Successfully updated: {} to {}'.format(
                        upped_repo_info.name,
                        upped_repo_info.last_commit_hash[:7]))
            except:
                logger.info(
                    'Can not update repo: {}  (Run in debug to see why)'.
                    format(repo_info.name))