Check that everything runs alright, and grab the gpg binary's
        version number while we're at it, storing it as :data:`binary_version`.

        :raises RuntimeError: if we cannot invoke the gpg binary.
328610
def _check_sane_and_get_gpg_version(self):
        
        proc = self._open_subprocess(["--list-config", "--with-colons"])
        result = self._result_map['list'](self)
        self._read_data(proc.stdout, result)
        if proc.returncode:
            raise RuntimeError("Error invoking gpg: %s" % result.data)
        else:
            try:
                proc.terminate()
            except OSError:
                log.error(("Could neither invoke nor terminate a gpg process... "
                           "Are you sure you specified the corrent (and full) "
                           "path to the gpg binary?"))

        version_line = result.data.partition(b':version:')[2].decode()
        if not version_line:
            raise RuntimeError("Got invalid version line from gpg: %s\n" % result.data)
        self.binary_version = version_line.split('\n')[0]
        if not _VERSION_RE.match(self.binary_version):
            raise RuntimeError("Got invalid version line from gpg: %s\n" % self.binary_version)
        log.debug("Using GnuPG version %s" % self.binary_version)
562502
def get_version():
    
    # Get location of application wide version info
    root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
    version_file = os.path.join(root_dir, 'safe', 'definitions', 'versions.py')
    fid = open(version_file)
    version = ''
    for line in fid.readlines():
        if line.startswith('inasafe_version'):
            version = line.strip().split(' = ')[1]
            version = version.replace('\'', '')
            break
    fid.close()
    if version:
        return version
    else:
        raise Exception('Version is not found in %s' % version_file)
304752
def check_version(self, check, timeout=None, metadata=None,
                      credentials=None):
        """"""
        return self.stub.CheckVersion(check, timeout=timeout,
                                      metadata=metadata,
                                      credentials=credentials)
85025
def _check_version(version):
    """"""
    if version != pyphi.__version__:
        raise pyphi.exceptions.JSONVersionError(
            'Cannot load JSON from a different version of PyPhi. '
            'JSON version = {0}, current version = {1}.'.format(
                version, pyphi.__version__))
379352
def get_version():
    """"""
    config = RawConfigParser()
    config.read(os.path.join('..', 'setup.cfg'))
    return config.get('metadata', 'version')
330241
def _check_pypi_version(self):
        
        try:
            check_version()
        except VersionException as err:
            print(str(err), file=sys.stderr)
            time.sleep(TWO_SECONDS)
550591
def get_git_version(cls):
        
        try:
            output = cls.run_git_shell('git version')
        except CalledProcessError:
            cls.LOG.warning("Unable to get Git version.")
            return None

        try:
            version = output.split()[2]
        except IndexError:
            cls.LOG.warning("Unable to parse Git version \"%s\".", output)
            return None

        try:
            return tuple(int(v) for v in version.split('.'))
        except ValueError:
            cls.LOG.warning("Unable to parse Git version \"%s\".", version)
            return None
633420
def show_version(self):
        
        version_info = self.get_cli_version()
        version_info += self.get_runtime_version()
        print(version_info, file=self.out_file)
1035807
def version():
    '''
    
    '''
    cmd = '{0} -v'.format(_detect_os())
    out = __salt__['cmd.run'](cmd).splitlines()
    ret = out[0].split(': ')
    return ret[1]
1097757
def get_version(with_git_hash=True, refresh_hash=False):
    """"""
    version = __version__
    if with_git_hash:
        global INDRA_GITHASH
        if INDRA_GITHASH is None or refresh_hash:
            with open(devnull, 'w') as nul:
                try:
                    ret = check_output(['git', 'rev-parse', 'HEAD'],
                                       cwd=dirname(__file__), stderr=nul)
                except CalledProcessError:
                    ret = 'UNHASHED'
            INDRA_GITHASH = ret.strip().decode('utf-8')
        version = '%s-%s' % (version, INDRA_GITHASH)
    return version
940770
def version_info(self):
        

        # Retrive and show local version info
        package = pkg.get_distribution('git-up')
        local_version_str = package.version
        local_version = package.parsed_version

        print('GitUp version is: ' + colored('v' + local_version_str, 'green'))

        if not self.settings['updates.check']:
            return

        # Check for updates
        print('Checking for updates...', end='')

        try:
            # Get version information from the PyPI JSON API
            reader = codecs.getreader('utf-8')
            details = json.load(reader(urlopen(PYPI_URL)))
            online_version = details['info']['version']
        except (HTTPError, URLError, ValueError):
            recent = True  # To not disturb the user with HTTP/parsing errors
        else:
            recent = local_version >= pkg.parse_version(online_version)

        if not recent:
            # noinspection PyUnboundLocalVariable
            print(
                '\rRecent version is: '
                + colored('v' + online_version, color='yellow', attrs=['bold'])
            )
            print('Run \'pip install -U git-up\' to get the update.')
        else:
            # Clear the update line
            sys.stdout.write('\r' + ' ' * 80 + '\n')
385199
def _get_bgzip_version(exe):
    """"""
    p = subprocess.Popen([exe, "-h"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
    output = p.communicate()
    version_line = output[0].splitlines()[1]
    version = re.match(r"(?:Version:|bgzip \(htslib\))\s+(\d+\.\d+(\.\d+)?)", version_line).group(1)
    return version
337673
def check_version(version):
    

    if isinstance(version, string_types):
        version = tuple(map(int, version.split(".")))

    if version > version_info:
        str_version = ".".join(map(str, version))
        raise ValueError("pgi version '%s' requested, '%s' available" %
                         (str_version, __version__))
219862
def check_version():
    
    if sys.version_info[0:3] == PYTHON_VERSION_INFO[0:3]:
        return

    sys.exit(
        ansi.error() + ' your virtual env points to the wrong python version. '
                       'This is likely because you used a python installer that clobbered '
                       'the system installation, which breaks virtualenv creation. '
                       'To fix, check this symlink, and delete the installation of python '
                       'that it is brokenly pointing to, then delete the virtual env itself '
                       'and rerun lore install: ' + os.linesep + os.linesep + BIN_PYTHON +
        os.linesep
    )
817523
def get_version(self):
        

        result = self._client.get("version").content

        if isinstance(result, bytes):
            result = result.decode('utf-8')

        return result.strip('\n')
769396
def _get_version():
    '''
    
    '''
    version_string = __salt__['cmd.run'](
        [_check_xbps(), '--version'],
        output_loglevel='trace')
    if version_string is None:
        # Dunno why it would, but...
        return False

    VERSION_MATCH = re.compile(r'(?:XBPS:[\s]+)([\d.]+)(?:[\s]+.*)')
    version_match = VERSION_MATCH.search(version_string)
    if not version_match:
        return False

    return version_match.group(1).split('.')
80009
def get_pypi_version(self):
        
        if self.args.disable_check_update:
            return

        # If the cached file exist, read-it
        cached_data = self._load_cache()

        if cached_data == {}:
            # Update needed
            # Update and save the cache
            thread = threading.Thread(target=self._update_pypi_version)
            thread.start()
        else:
            # Update not needed
            self.data['latest_version'] = cached_data['latest_version']
            logger.debug("Get Glances version from cache file")