config.py 文件源码

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

项目:onefl-deduper 作者: ufbmi 项目源码 文件源码
def from_object(self, obj):
        """Updates the values from the given object.  An object can be of one
        of the following two types:
        -   a string: in this case the object with that name will be imported
        -   an actual object reference: that object is used directly
        :param obj: an import name or object
        """
        string_types = (str,)

        if isinstance(obj, string_types):
            # github.com/pallets/werkzeug/blob/master/werkzeug/utils.py+L399
            # obj = import_string(obj)
            obj = importlib.import_module(obj)

        for key in dir(obj):
            if key.isupper():
                self[key] = getattr(obj, key)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号