Exemplo n.º 1
0
def updateRunning():
    update = getConfig('update_running', 'false')
    if update != 'false':
        starttime = strp(update, '%Y-%m-%d %H:%M')
        if (starttime + timedelta(hours=6)) <= datetime.today():
            writeConfig('update_running', 'false')
            Log('DB Cancel update - duration > 6 hours')
        else:
            Log('DB Update already running', xbmc.LOGDEBUG)
            return True
    return False
Exemplo n.º 2
0
def updateRunning():
    from datetime import datetime, timedelta
    update = getConfig('update_running', 'false')
    if update != 'false':
        starttime = strp(update, '%Y-%m-%d %H:%M')
        if (starttime + timedelta(hours=6)) <= datetime.today():
            writeConfig('update_running', 'false')
            Log('DB Cancel update - duration > 6 hours')
        else:
            Log('DB Update already running', xbmc.LOGDEBUG)
            return True
    return False
Exemplo n.º 3
0
    if update != 'false':
        starttime = strp(update, '%Y-%m-%d %H:%M')
        if (starttime + timedelta(hours=6)) <= datetime.today():
            writeConfig('update_running', 'false')
            Log('DB Cancel update - duration > 6 hours')
        else:
            Log('DB Update already running', xbmc.LOGDEBUG)
            return True
    return False


if __name__ == '__main__':
    addon = xbmcaddon.Addon()
    monitor = xbmc.Monitor()
    Log('AmazonDB: Service Start')
    writeConfig('update_running', 'false')
    writeConfig('login')
    freq = int('0' + var.addon.getSetting('auto_update'))
    checkfreq = 60
    idleupdate = 300
    startidle = 0

    if freq:
        while not monitor.abortRequested():
            from datetime import datetime, timedelta
            today = datetime.today()
            freq = var.addon.getSetting('auto_update')
            time = var.addon.getSetting('update_time')
            time = '00:00' if time == '' else time
            last = getConfig('last_update', '1970-01-01')
            update_run = updateRunning()
Exemplo n.º 4
0
    if update != 'false':
        starttime = strp(update, '%Y-%m-%d %H:%M')
        if (starttime + timedelta(hours=6)) <= datetime.today():
            writeConfig('update_running', 'false')
            Log('DB Cancel update - duration > 6 hours')
        else:
            Log('DB Update already running', xbmc.LOGDEBUG)
            return True
    return False


if __name__ == '__main__':
    addon = xbmcaddon.Addon()
    monitor = xbmc.Monitor()
    Log('AmazonDB: Service Start')
    writeConfig('update_running', 'false')
    freq = int('0' + var.addon.getSetting('auto_update'))
    checkfreq = 60
    idleupdate = 300
    startidle = 0

    if freq:
        while not monitor.abortRequested():
            from datetime import datetime, timedelta
            today = datetime.today()
            freq = var.addon.getSetting('auto_update')
            time = var.addon.getSetting('update_time')
            time = '00:00' if time == '' else time
            last = getConfig('last_update', '1970-01-01')
            update_run = updateRunning()