connector.py 文件源码

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

项目:webtzite 作者: materialsproject 项目源码 文件源码
def split_config(config):
        """Split the 'config' object into a set of fields.

        :param config: Configuration
        :type param: dict or str
        :raises: yaml.error.YAMLError if config is a str that doesn't parse
        """
        if not isinstance(config, dict):
            config = yaml.load(config)
        db = config.get("db", None)
        host = config.get("host", "0.0.0.0")
        user_name = config.get("user_name", None)
        password = config.get("password", None)
        port = int(config.get("port", 27017))
        coll = config.get("collection", None)
        return db, host, user_name, password, port, coll
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号