Esempio n. 1
0
def start_rytec_service():
    from resources.lib import rytec
    print '[Rytec EPG Downloader]: rytec service started'
    descriptions = common.get_descriptions()
    sources_list = None
    merge = False
    for description in descriptions:
        ret = False
        epg_url = common.get_description_url(description)
        if epg_url:
            ret = common.load_local_xml(epg_url)
            if ret:
                print '[Rytec EPG Downloader]: no epg update needed', description
            else:
                ret = rytec.download_epg(epg_url)
                if ret: merge = True
        if not ret:
            if not sources_list: sources_list = rytec.get_sources_list()
            if sources_list:
                ret = rytec.get_epg(sources_list, description)
                if ret:
                    merge = True
                else:
                    xbmc.executebuiltin('Notification(could not download epg data,)')
                    print '[Rytec EPG Downloader]: could not download epg data', description
            else:
                xbmc.executebuiltin('Notification(could not download sources list,)')
                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
Esempio n. 2
0
 def __init__(self, manual=False):
 
     common.log('[Rytec EPG Downloader]: rytec downloader started')
     self.manual       = manual
     self.sources_list = []
     self.i            = 0
     
     self.descriptions = common.get_descriptions()
     self.len_desc     = len(self.descriptions)
     if self.len_desc == 0:
         common.log('[Rytec EPG Downloader]: empty epg setting')
         return
     self.upd          = 60/self.len_desc
         
     self.progress('create', '', 'Rytec EPG Downloader', '', 'Downloading XML Data')
     self.run()
Esempio n. 3
0
    def __init__(self, manual=False):

        common.log('[Rytec EPG Downloader]: rytec downloader started')
        self.manual = manual
        self.sources_list = []
        self.i = 0

        self.descriptions = common.get_descriptions()
        self.len_desc = len(self.descriptions)
        if self.len_desc == 0:
            common.log('[Rytec EPG Downloader]: empty epg setting')
            return
        self.upd = 60 / self.len_desc

        self.progress('create', '', 'Rytec EPG Downloader', '',
                      'Downloading XML Data')
        self.run()
def start_rytec_service(manual=False):
    from resources.lib import rytec
    print '[Rytec EPG Downloader]: rytec service started'
    descriptions = common.get_descriptions()
    sources_list = None
    merge = False
    for description in descriptions:
        ret = False
        if description.startswith('http'):
            epg_url = description
        else:
            epg_url = common.get_description_url(description)
        if epg_url:
            ret = common.load_local_xml(epg_url)
            if ret:
                print '[Rytec EPG Downloader]: no epg update needed', description
            else:
                if description.startswith('http'):
                    if manual:
                        ret = rytec.download_epg(epg_url)
                if not manual:
                    ret = rytec.download_epg(epg_url)
                    if ret: merge = True
        if not ret and not description.startswith('http'):
            if not sources_list: sources_list = rytec.get_sources_list()
            if sources_list:
                ret = rytec.get_epg(sources_list, description)
                if ret:
                    merge = True
                else:
                    xbmc.executebuiltin(
                        'Notification(could not download epg data,)')
                    print '[Rytec EPG Downloader]: could not download epg data', description
            else:
                xbmc.executebuiltin(
                    'Notification(could not download sources list,)')
                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