コード例 #1
0
ファイル: postgres.py プロジェクト: vonion/salt
def _parsed_version(user=None,
                    host=None,
                    port=None,
                    maintenance_db=None,
                    password=None,
                    runas=None):
    '''
    Returns the server version properly parsed and int casted for internal use.

    If the Postgres server does not respond, None will be returned.
    '''

    psql_version = version(
        user,
        host=host,
        port=port,
        maintenance_db=maintenance_db,
        password=password,
        runas=runas,
    )

    if psql_version:
        return distutils.version.LooseVersion(psql_version)
    else:
        log.warning('Attempt to parse version of Postgres server failed.'
                    'Is the server responding?')
        return None
コード例 #2
0
ファイル: postgres.py プロジェクト: jslatts/salt
def _parsed_version(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None):
    """
    Returns the server version properly parsed and int casted for internal use
    """

    psql_version = version(user, host, port, maintenance_db, password, runas)
    return distutils.version.LooseVersion(psql_version)
コード例 #3
0
ファイル: postgres.py プロジェクト: micahhausler/salt
def _parsed_version(user=None, host=None, port=None, maintenance_db=None,
                    password=None, runas=None):
    '''
    Returns the server version properly parsed and int casted for internal use
    '''

    psql_version = version(
        user, host, port, maintenance_db, password, runas
    )
    return distutils.version.LooseVersion(psql_version)
コード例 #4
0
ファイル: postgres.py プロジェクト: ricardoheyn/forzen-salt
def _parsed_version(user=None, host=None, port=None, maintenance_db=None,
                    password=None, runas=None):
    '''
    Returns the server version properly parsed and int casted for internal use.

    If the Postgres server does not respond, None will be returned.
    '''

    psql_version = version(
        user, host, port, maintenance_db, password, runas
    )

    if psql_version:
        return distutils.version.LooseVersion(psql_version)
    else:
        log.warning('Attempt to parse version of Postgres server failed. Is the server responding?')
        return None
コード例 #5
0
def _main(argv=None):
    import argparse
    parser = argparse.ArgumentParser(prog="python -m ensurepip")
    parser.add_argument(
        "--version",
        action="version",
        version="pip {}".format(version()),
        help="Show the version of pip that is bundled with this Python.",
    )
    parser.add_argument(
        "-v",
        "--verbose",
        action="count",
        default=0,
        dest="verbosity",
        help=("Give more output. Option is additive, and can be used up to 3 "
              "times."),
    )
    parser.add_argument(
        "-U",
        "--upgrade",
        action="store_true",
        default=False,
        help="Upgrade pip and dependencies, even if already installed.",
    )
    parser.add_argument(
        "--user",
        action="store_true",
        default=False,
        help="Install using the user scheme.",
    )
    parser.add_argument(
        "--root",
        default=None,
        help="Install everything relative to this alternate root directory.",
    )
    parser.add_argument(
        "--altinstall",
        action="store_true",
        default=False,
        help=("Make an alternate install, installing only the X.Y versioned "
              "scripts (Default: pipX, pipX.Y, easy_install-X.Y)."),
    )
    parser.add_argument(
        "--default-pip",
        action="store_true",
        default=True,
        dest="default_pip",
        help=argparse.SUPPRESS,
    )
    parser.add_argument(
        "--no-default-pip",
        action="store_false",
        dest="default_pip",
        help=("Make a non default install, installing only the X and X.Y "
              "versioned scripts."),
    )

    args = parser.parse_args(argv)

    return _bootstrap(
        root=args.root,
        upgrade=args.upgrade,
        user=args.user,
        verbosity=args.verbosity,
        altinstall=args.altinstall,
        default_pip=args.default_pip,
    )
コード例 #6
0
def using_xcode_11_or_higher():
    """Returns true if using Xcode version 11 or higher."""
    LOGGER.debug('Checking if Xcode version is 11 or higher')
    return distutils.version.LooseVersion(
        '11.0') <= distutils.version.LooseVersion(version()[0])