def simpleUpdateChecker(colors): # run the autmoatic updater, but only alert if an update is available available = Updater.check(colors, False) if not available == None and available[0]: response = raw_input(colors.alert() + '::Update Alert::\nThere is an update available. Would you like to download it now? ' + colors.end()).lower() if response in ('y', 'yes', 'u', 'update', 'd', 'download', 'get', 'get it', 'install', 'install update'): verified = Updater.getUpdate(fastSearchDir, colors, available[1], available[2]) if not verified: print colors.error() + '\nAn error occurred while trying to download and install the update. Check your internet connection and try again.\nIf the problem persists, contact the developer.\n' + colors.end() else: print colors.alert() + 'No updates were downloaded or installed.\n' + colors.end()
def runUpdater(fastSearchDir, colors): available = Updater.check(colors, True) if not available == None: if available[0] == True: response = raw_input(colors.blue() + 'There is an update available. Download? ' + colors.end()).lower() if response in ('y', 'yes', 'u', 'update', 'd', 'download', 'get', 'get it', 'install', 'install update'): verified = Updater.getUpdate(fastSearchDir, colors, available[1], available[2]) if not verified: print colors.error() + '\nAn error occurred while trying to download and install the update. Check your internet connection and ' \ 'try again.\nIf the problem persists, try downloading the program again from fastsearch.alexlaird.net or contacting the developer.\n' + colors.end() else: print colors.alert() + 'No updates were downloaded or installed.\n' + colors.end() elif available[0] == -1: print colors.alert() + 'An update is available, but the current version of FastSearch cannot be automatically updated.\nPlease navigate to ' \ 'fastsearch.alexlaird.net in order to download and install the update.\n' + colors.end() else: print colors.alert() + 'There are no updates available at this time.\n' + colors.end()