Python psycopg2 模块,__version__() 实例源码

我们从Python开源项目中,提取了以下21个代码示例,用于说明如何使用psycopg2.__version__()

项目:psycopg2-for-aws-lambda    作者:iwitaly    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:psycopg2-for-aws-lambda    作者:iwitaly    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:gprime    作者:GenealogyCollective    | 项目源码 | 文件源码
def get_summary(cls):
        """
        Return a diction of information about this database
        backend.
        """
        summary = {
            "DB-API version": "2.0",
            "Database SQL type": cls.__name__,
            "Database SQL module": "psycopg2",
            "Database SQL module version": psycopg2.__version__,
            "Database SQL module location": psycopg2.__file__,
        }
        return summary
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:userbase-sns-lambda    作者:fartashh    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:nmbs-realtime-feed    作者:datamindedbe    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:aws-lambda-redshift-copy    作者:christianhxc    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def make_psycopg_green():
    """Configure Psycopg to be used with eventlet in non-blocking way."""
    if not hasattr(extensions, 'set_wait_callback'):
        raise ImportError(
            "support for coroutines not available in this Psycopg version (%s)"
            % psycopg2.__version__)

    extensions.set_wait_callback(eventlet_wait_callback)
项目:ansible-provider-docs    作者:alibaba    | 项目源码 | 文件源码
def ensure_libs(sslrootcert=None):
    if not HAS_PSYCOPG2:
        raise LibraryError('psycopg2 is not installed. we need psycopg2.')
    if sslrootcert and psycopg2.__version__ < '2.4.3':
        raise LibraryError('psycopg2 must be at least 2.4.3 in order to use the ssl_rootcert parameter')

    # no problems
    return None
项目:PyEloqua-Examples    作者:colemanja91    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")
项目:deb-python-eventlet    作者:openstack    | 项目源码 | 文件源码
def make_psycopg_green():
    """Configure Psycopg to be used with eventlet in non-blocking way."""
    if not hasattr(extensions, 'set_wait_callback'):
        raise ImportError(
            "support for coroutines not available in this Psycopg version (%s)"
            % psycopg2.__version__)

    extensions.set_wait_callback(eventlet_wait_callback)
项目:Sentry    作者:NetEaseGame    | 项目源码 | 文件源码
def make_psycopg_green():
    """Configure Psycopg to be used with gevent in non-blocking way."""
    if not hasattr(extensions, 'set_wait_callback'):
        raise ImportError(
            "support for coroutines not available in this Psycopg version (%s)"
            % psycopg2.__version__)

    extensions.set_wait_callback(gevent_wait_callback)
项目:flask    作者:bobohope    | 项目源码 | 文件源码
def _has_lo64(conn):
    """Return (bool, msg) about the lo64 support"""
    if conn.server_version < 90300:
        return (False, "server version %s doesn't support the lo64 API"
                % conn.server_version)

    if 'lo64' not in psycopg2.__version__:
        return (False, "this psycopg build doesn't support the lo64 API")

    return (True, "this server and build support the lo64 API")