当前位置: 首页>>代码示例>>Python>>正文


Python pymongo.version方法代码示例

本文整理汇总了Python中pymongo.version方法的典型用法代码示例。如果您正苦于以下问题:Python pymongo.version方法的具体用法?Python pymongo.version怎么用?Python pymongo.version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymongo的用法示例。


在下文中一共展示了pymongo.version方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_compatibility

# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def check_compatibility(module, client):
    srv_info = client.server_info()
    if LooseVersion(PyMongoVersion) <= LooseVersion('3.2'):
        module.fail_json(msg='Note: you must use pymongo 3.2+')
    if LooseVersion(srv_info['version']) >= LooseVersion('3.4') and LooseVersion(PyMongoVersion) <= LooseVersion('3.4'):
        module.fail_json(msg='Note: you must use pymongo 3.4+ with MongoDB 3.4.x')
    if LooseVersion(srv_info['version']) >= LooseVersion('3.6') and LooseVersion(PyMongoVersion) <= LooseVersion('3.6'):
        module.fail_json(msg='Note: you must use pymongo 3.6+ with MongoDB 3.6.x') 
开发者ID:UnderGreen,项目名称:ansible-role-mongodb,代码行数:10,代码来源:mongodb_replication.py

示例2: get_summary

# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def get_summary(self):
        """
        Return a dictionary of information about this database backend.
        """
        summary = super().get_summary()
        summary.update({
            _("Database version"): version,
        })
        return summary 
开发者ID:gramps-project,项目名称:addons-source,代码行数:11,代码来源:mongodb.py

示例3: check_dependencies

# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def check_dependencies(self):
        try:
            import nose
            self.logger.debug("\tNose: %s\n" % str(nose.__version__))
        except ImportError:
            raise ImportError("Nose cannot be imported. Are you sure it's "
                              "installed?")
        try:
            import networkx
            self.logger.debug("\tnetworkx: %s\n" % str(networkx.__version__))
        except ImportError:
            raise ImportError("Networkx cannot be imported. Are you sure it's "
                              "installed?")
        try:
            import pymongo
            self.logger.debug("\tpymongo: %s\n" % str(pymongo.version))
            from bson.objectid import ObjectId
        except ImportError:
            raise ImportError("Pymongo cannot be imported. Are you sure it's"
                              " installed?")
        try:
            import numpy
            self.logger.debug("\tnumpy: %s" % str(numpy.__version__))
        except ImportError:
            raise ImportError("Numpy cannot be imported. Are you sure that it's"
                              " installed?")
        try:
            import scipy
            self.logger.debug("\tscipy: %s" % str(scipy.__version__))
        except ImportError:
            raise ImportError("Scipy cannot be imported. Are you sure that it's"
                              " installed?") 
开发者ID:automl,项目名称:HPOlib,代码行数:34,代码来源:random_hyperopt_august2013_mod.py

示例4: get_library_versions

# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def get_library_versions(cls):
        return {'pymongo': pymongo.version} 
开发者ID:DataDog,项目名称:integrations-core,代码行数:4,代码来源:mongo.py


注:本文中的pymongo.version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。