Exemplo n.º 1
0
def service():

    monitor = xbmc.Monitor()
    a = False

    while not monitor.abortRequested():
        if monitor.waitForAbort(1):
            break

        if not (xbmc.Player().isPlaying()
                or xbmc.getCondVisibility('Library.IsScanningVideo')):
            if common.download_allowed(a):
                if not common.blocked(a):
                    DOWNLOADER()
            a = True


if __name__ == '__main__':

    if common.get_xml_path() and common.get_activation_code():

        if common.manual_download() == True:
            dialog = xbmcgui.Dialog()
            ret = dialog.yesno('Rytec EPG Downloader', 'Start Manual Download')
            if ret:
                manual = True
                DOWNLOADER(manual)
                ok = dialog.ok('Rytec EPG Downloader',
                               'Manual Download Finished')
        else:
            service()
Exemplo n.º 2
0
                print '[Rytec EPG Downloader]: could not download sources list'
    if merge and len(descriptions) > 1: 
        try:
            common.merge_epg()
        except Exception, e:
            xbmc.executebuiltin('Notification(could not merge epg,)')
            print '[Rytec EPG Downloader]: could not merge epg', e

def service():
    a = False
    while (not xbmc.abortRequested):
        if not (xbmc.Player().isPlaying() or xbmc.getCondVisibility('Library.IsScanningVideo')):
            if common.download_allowed(a):
                if not common.blocked(a):
                    start_rytec_service()
            else:
                if not a: 
                    xbmc.executebuiltin('Notification(epg download currently not allowed,)')
            a = True
        xbmc.sleep(1000)

if common.get_xml_path() and common.get_activation_code():
    try:
        if sys.argv[1:][0] == 'manual_download':
            dialog = xbmcgui.Dialog()
            ret = dialog.yesno('Rytec EPG Downloader', 'Start Manual Download')
            if ret:
                start_rytec_service()
                ok = dialog.ok('Rytec EPG Downloader', 'Manual Download Finished')
    except:
        service()