本文整理汇总了Python中twisted.version方法的典型用法代码示例。如果您正苦于以下问题:Python twisted.version方法的具体用法?Python twisted.version怎么用?Python twisted.version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted
的用法示例。
在下文中一共展示了twisted.version方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ensure_outgoing_proxy_dependencies
# 需要导入模块: import twisted [as 别名]
# 或者: from twisted import version [as 别名]
def ensure_outgoing_proxy_dependencies():
"""Make sure that we have the necessary dependencies to connect to
outgoing HTTP/SOCKS proxies.
Raises OutgoingProxyDepsFailure in case of error.
"""
# We can't connect to outgoing proxies without txsocksx.
try:
import txsocksx
except ImportError:
raise OutgoingProxyDepsFailure("We don't have txsocksx. Can't do proxy. Please install txsocksx.")
# We also need a recent version of twisted ( >= twisted-13.2.0)
import twisted
from twisted.python import versions
if twisted.version < versions.Version('twisted', 13, 2, 0):
raise OutgoingProxyDepsFailure("Outdated version of twisted (%s). Please upgrade to >= twisted-13.2.0" % twisted.version.short())
示例2: doWarnings
# 需要导入模块: import twisted [as 别名]
# 或者: from twisted import version [as 别名]
def doWarnings():
import twisted
from twisted.python import versions
if (twisted.version < versions.Version('twisted', 8, 0, 0)):
LOG.warning("You should get Twisted 8 or later. Previous versions "
"have some bugs that affect Dtella.")
try:
import dtella.bridge
except ImportError:
# Don't warn about GMP for clients, because verifying a signature
# is fast enough without it (~1ms on a Core2)
pass
else:
import Crypto.PublicKey
try:
import Crypto.PublicKey._fastmath
except ImportError:
LOG.warning("Your version of PyCrypto was compiled without "
"GMP (fastmath). Signing messages will be slower.")