コード例 #1
0
ファイル: APODDownloader.py プロジェクト: lynxrv21/variety
    def fill_queue_from_rss(self):
        logger.info(lambda: "Filling APOD queue from RSS")

        s = self.fetch(self.location, xml=True)
        urls = [_str(x.find("link").contents[0]) for x in s.findAll("item")]
        urls = [x for x in urls if x not in self.parent.banned]

        self.queue.extend(urls)

        logger.info(lambda: "APOD queue populated with %d URLs" % len(self.queue))
コード例 #2
0
ファイル: APODDownloader.py プロジェクト: GLolol/variety-deb
    def fill_queue_from_rss(self):
        logger.info(lambda: "Filling APOD queue from RSS")

        s = self.fetch(self.location, xml=True)
        urls = [_str(x.find("link").contents[0]) for x in s.findAll("item")]
        urls = [x for x in urls if x not in self.parent.banned]

        self.queue.extend(urls)

        logger.info(lambda: "APOD queue populated with %d URLs" % len(self.queue))
コード例 #3
0
ファイル: Options.py プロジェクト: GLolol/variety-deb
 def fix_outdated(self, config):
     changed = False
     for key, outdated_hashes in Options.OUTDATED_HASHES.items():
         if key in config:
             current_hash = hashlib.md5(_str(config[key])).hexdigest()
             if current_hash in outdated_hashes:
                 # entry is outdated: delete it and use the default
                 logger.warning(lambda: "Option " + key + " has an outdated value, using the new default")
                 changed = True
                 del config[key]
     return changed
コード例 #4
0
 def fix_outdated(self, config):
     changed = False
     for key, outdated_hashes in Options.OUTDATED_HASHES.items():
         if key in config:
             current_hash = hashlib.md5(_str(config[key])).hexdigest()
             if current_hash in outdated_hashes:
                 # entry is outdated: delete it and use the default
                 logger.warning(
                     lambda: "Option " + key +
                     " has an outdated value, using the new default")
                 changed = True
                 del config[key]
     return changed
コード例 #5
0
 def superuser_exec(*command_args):
     logger.warning(lambda: "Executing as superuser: %s" % _str(command_args))
     subprocess.check_call(["pkexec"] + list(command_args))
コード例 #6
0
ファイル: Util.py プロジェクト: brandonJY/variety
 def superuser_exec(*command_args):
     logger.warning(lambda: "Executing as superuser: %s" % _str(command_args))
     subprocess.check_call(["pkexec"] + list(command_args))