本文整理匯總了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')
示例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
示例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?")
示例4: get_library_versions
# 需要導入模塊: import pymongo [as 別名]
# 或者: from pymongo import version [as 別名]
def get_library_versions(cls):
return {'pymongo': pymongo.version}