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