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


Python twisted.version方法代码示例

本文整理汇总了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()) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:20,代码来源:network.py

示例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.") 
开发者ID:ffledgling,项目名称:dtella,代码行数:22,代码来源:core.py


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