mail.py 文件源码

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

项目:girlfriend 作者: chihongze 项目源码 文件源码
def validate_config(self, config):
        """????????????????"""
        if self._validated:
            return
        for section in config.prefix("smtp_"):
            smtp_config_items = config[section]
            for rule in SMTPManager.config_rules:
                item_value = smtp_config_items.get(rule.name)
                rule.validate(item_value)
                if item_value is None:
                    smtp_config_items[rule.name] = rule.default
                if rule.name == "port" and isinstance(
                        item_value, types.StringTypes):
                    smtp_config_items["port"] = int(item_value)
            smtp_config = SMTPConfig(**smtp_config_items)
            self._all_smtp_config[section] = smtp_config
        self._validated = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号