tumblesle_release.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:openqa_review 作者: okurz 项目源码 文件源码
def __init__(self, args):
        """Construct object and save forwarded arguments."""
        verbose_to_log = {
            0: logging.CRITICAL,
            1: logging.ERROR,
            2: logging.WARN,
            3: logging.INFO,
            4: logging.DEBUG
        }
        logging_level = logging.DEBUG if args.verbose > 4 else verbose_to_log[args.verbose]
        log.setLevel(logging_level)
        log.debug("args: %s" % args)
        self.args = args
        config = ConfigParser()
        config_entries = config.read(self.args.config_path)
        self.whitelist = [i.strip() for i in args.whitelist.split(',')]
        if config_entries:
            self.whitelist += [i.strip() for i in config.get(self.args.product, 'whitelist').split(',')]
        else:
            log.info("No configuration file '{}' for whitelist, only using optionally specified command line whitelist".format(self.args.config_path))
            log.debug(CONFIG_USAGE)
        # does not look so nice, can be improved. Removing empty string entries.
        self.whitelist = [i for i in self.whitelist if i]
        log.info("Whitelist content for %s: %s" % (self.args.product, self.whitelist))
        self.release_info_path = os.path.join(self.args.dest, self.args.release_file)
        self.browser = Browser(args, args.openqa_host)
        if not config.has_section('notification'):
            return
        self.credentials = pika.PlainCredentials(config.get('notification', 'username', fallback='guest'),
                                                 config.get('notification', 'password', fallback='guest'))
        self.notify_host = config.get('notification', 'host', fallback='kazhua.suse.de')
        self.notify_connect()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号