def prepare_updater():
    'Returns an Updater object for the configured updater.'
    if lnp.updater:
        return lnp.updater
    updaters = {'regex': RegexUpdater, 'json': JSONUpdater, 'dffd': DFFDUpdater}
    updater_id = lnp.config.get('updates/updateMethod', None)
    if (updater_id is None):
        log.w('Update method not configured in PyLNP.json! Will attempt to auto-detect. Please set this value correctly, auto-detection will go away eventually!')
        if lnp.config.get_string('updates/dffdID'):
            updater_id = 'dffd'
            log.w('Updater detected: dffd')
        elif lnp.config.get_string('updates/versionRegex'):
            updater_id = 'regex'
            log.w('Updater detected: regex')
        elif lnp.config.get_string('updates/versionJsonPath'):
            updater_id = 'json'
            log.w('Updater detected: json')
        else:
            log.w('Could not detect update method, updates will not work')
            return None
    elif ((updater_id == '') or (not lnp.config.get('updates'))):
        return None
    if (updater_id not in updaters):
        log.e(('Unknown update method: ' + updater_id))
        return None
    lnp.updater = updaters[updater_id]()
    return lnp.updater
Returns an Updater object for the configured updater.
def prepare_updater():
    
    if lnp.updater:
        return lnp.updater
    updaters = {'regex': RegexUpdater, 'json': JSONUpdater, 'dffd': DFFDUpdater}
    updater_id = lnp.config.get('updates/updateMethod', None)
    if (updater_id is None):
        log.w('Update method not configured in PyLNP.json! Will attempt to auto-detect. Please set this value correctly, auto-detection will go away eventually!')
        if lnp.config.get_string('updates/dffdID'):
            updater_id = 'dffd'
            log.w('Updater detected: dffd')
        elif lnp.config.get_string('updates/versionRegex'):
            updater_id = 'regex'
            log.w('Updater detected: regex')
        elif lnp.config.get_string('updates/versionJsonPath'):
            updater_id = 'json'
            log.w('Updater detected: json')
        else:
            log.w('Could not detect update method, updates will not work')
            return None
    elif ((updater_id == ) or (not lnp.config.get('updates'))):
        return None
    if (updater_id not in updaters):
        log.e(('Unknown update method: ' + updater_id))
        return None
    lnp.updater = updaters[updater_id]()
    return lnp.updater