當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。