Beispiel #1
0
    def _download_update_xml(self):
        """downloads update xml of repository"""

        # hack for https github urls
        # since some receivers have have problems with https
        if self.update_xml_url.find('{commit}') != -1:
            from Plugins.Extensions.archivCZSK.settings import PLUGIN_PATH
            try:
                commit = open(os.path.join(PLUGIN_PATH,
                                           'commit')).readline()[:-1]
            except Exception:
                commit = '4ff9ac15d461a885f13125125ea501f3b12eb05d'
            self.update_xml_url = self.update_xml_url.replace(
                '{commit}', commit)
        if self.update_xml_url.find('https://raw.github.com') == 0:
            update_xml_url = self.update_xml_url.replace(
                'https://raw.github.com', 'http://rawgithub.com')
        else:
            update_xml_url = self.update_xml_url
        try:
            util.download_to_file(update_xml_url,
                                  self.update_xml_file,
                                  debugfnc=log.debug)
        except Exception:
            log.error('cannot download %s update xml', self.repository.name)
            raise UpdateXMLVersionError()
Beispiel #2
0
    def _download_update_xml(self):
        """downloads update xml of repository"""

        # hack for https github urls
        # since some receivers have have problems with https
        if self.update_xml_url.find('https://raw.github.com') == 0:
            update_xml_url = self.update_xml_url.replace(
                'https://raw.github.com', 'http://rawgithub.com')
        else:
            update_xml_url = self.update_xml_url
        try:
            util.download_to_file(update_xml_url,
                                  self.update_xml_file,
                                  debugfnc=log.debug)
        except Exception:
            log.debug('cannot download %s update xml', self.repository.name)
            raise UpdateXMLVersionError()