Example #1
0
    def run(self):

        for description in self.descriptions:

            common.log('[Rytec EPG Downloader]: ' + description)
            self.i += self.upd
            self.progress('update', self.i, 'Rytec EPG Downloader',
                          description, 'Downloading XML Data')
            ret = False
            epg_url = self.get_epg_url(description)

            if epg_url:
                ret = self.download_epg(description, epg_url)

            if not ret and not description.startswith('http'):
                self.run_rytec(description)

        self.progress('update', 70, 'Merging XML Data', ' ',
                      'Please Wait...This May Take Awhile')

        if self.len_desc > 1:
            common.merge_epg()
            self.progress('update', 90, 'Merging XML Data', ' ',
                          'Please Wait...This May Take Awhile')
            common.copy_temp_merged()
            common.delete_temp_merged()

        self.progress('close', '', '', '', '')
Example #2
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
Example #3
0
 def run(self):
 
     for description in self.descriptions:
 
         common.log('[Rytec EPG Downloader]: '+description)
         self.i += self.upd
         self.progress('update', self.i, 'Rytec EPG Downloader', description, 'Downloading XML Data')
         ret = False
         epg_url = self.get_epg_url(description)
         
         if epg_url:
             ret = self.download_epg(description, epg_url)
             
         if not ret and not description.startswith('http'):
             self.run_rytec(description)
             
     self.progress('update', 70, 'Merging XML Data', ' ', 'Please Wait...This May Take Awhile')
             
     if self.len_desc > 1:
         common.merge_epg()
         self.progress('update', 90, 'Merging XML Data', ' ', 'Please Wait...This May Take Awhile')
         common.copy_temp_merged()
         common.delete_temp_merged()
     
     self.progress('close', '', '', '', '')
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