示例#1
0
文件: service.py 项目: noba3/KoTos
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
示例#2
0
文件: service.py 项目: smplgd/repo
    def download_epg(self, description, epg_url):

        ret = common.load_local_xml(epg_url)
        if ret:
            common.log('[Rytec EPG Downloader]: no epg update needed')
        else:
            if description.startswith('http'):
                if self.manual == True:
                    ret = rytec.download_epg(epg_url)
            if self.manual == False:
                ret = rytec.download_epg(epg_url)

        return ret
示例#3
0
文件: service.py 项目: kodinerds/repo
 def download_epg(self, description, epg_url):
 
     ret = common.load_local_xml(epg_url)
     if ret:
         common.log('[Rytec EPG Downloader]: no epg update needed')
     else:
         if description.startswith('http'):
             if self.manual == True:
                 ret = rytec.download_epg(epg_url)
         if self.manual == False:
             ret = rytec.download_epg(epg_url)
             
     return ret
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