Show detailed information about a package.
765211
def show(ctx, integration, remote):
    """"""
    logger.debug("running command %s (%s)", ctx.command.name, ctx.params,
                 extra={"command": ctx.command.name, "params": ctx.params})

    home = ctx.obj["HOME"]
    integration_path = plugin_utils.get_plugin_path(home, defs.INTEGRATIONS, integration)

    def collect_local_info(integration, integration_path):
        logger.debug("loading {} from {}".format(integration, integration_path))
        integration = register_integration(integration_path)
        try:
            with open(os.path.join(integration_path, "requirements.txt"), "r") as fh:
                info["requirements"] = " ".join(fh.readlines())
        except IOError:
            pass
        info["name"] = integration.name
        info["label"] = integration.label
        info["location"] = integration_path

        return info

    def collect_remote_info(integration):
        rsession = requests.Session()
        rsession.mount("https://", HTTPAdapter(max_retries=3))

        try:
            r = rsession.get(defs.GITHUB_RAW_URL.format(plugin_type=defs.INTEGRATIONS,
                                                        plugin=integration, filename="config.json"))
            integration_config = r.json()
            info["name"] = integration_config[DISPLAY_NAME]
            info["label"] = integration_config[defs.DESCRIPTION]
            info["location"] = defs.GITHUB_URL.format(plugin_type=defs.INTEGRATIONS, plugin=info["name"])
        except requests.exceptions.HTTPError as exc:
            logger.debug(str(exc), exc_info=True)
            raise click.ClickException("Cannot find package {}".format(integration))
        except requests.exceptions.ConnectionError as exc:
            logger.debug(str(exc), exc_info=True)
            raise click.ClickException("Unable to reach remote repository {}".format(integration))

        try:
            r = rsession.get(defs.GITHUB_RAW_URL.format(plugin_type=defs.INTEGRATIONS,
                             plugin=info["name"], filename="requirements.txt"))
            r.raise_for_status()
            info["requirements"] = " ".join(r.text.split("\n"))
        except requests.exceptions.HTTPError as exc:
            logger.debug(str(exc), exc_info=True)
            info["requirements"] = None
        except requests.exceptions.ConnectionError as exc:
            logger.debug(str(exc), exc_info=True)
            raise click.ClickException("Unable to reach remote repository {}".format(integration))

        return info

    info = {"commit_revision": "N/A", "commit_date": "N/A", "requirements": "None"}

    if os.path.exists(integration_path):
        info["installed"] = True
        if remote:
            click.secho("[*] Fetching info from online repository")
            info.update(collect_remote_info(integration))
        else:
            info.update(collect_local_info(integration, integration_path))
    else:
        logger.debug("cannot find {} locally".format(integration))
        if not remote:
            click.secho("[*] Cannot find integration locally, checking online repository")
        info["installed"] = False
        info.update(collect_remote_info(integration))
    logger.debug(info)
    click.secho(PKG_INFO_TEMPLATE.format(**info))
157992
def info(gandi, resource, id, altnames, csr, cert, all_status):
    
    output_keys = ['cn', 'date_created', 'date_end', 'plan', 'status']

    if id:
        output_keys.append('id')

    if altnames:
        output_keys.append('altnames')

    if csr:
        output_keys.append('csr')

    if cert:
        output_keys.append('cert')

    ids = []
    for res in resource:
        ids.extend(gandi.certificate.usable_ids(res))

    result = []
    for num, id_ in enumerate(set(ids)):
        cert = gandi.certificate.info(id_)
        if not all_status and cert['status'] not in ['valid', 'pending']:
            continue
        if num:
            gandi.separator_line()
        cert['plan'] = package_desc(gandi, cert['package'])
        output_cert(gandi, cert, output_keys)
        result.append(cert)

    return result
568993
def print_results(self):
        """"""
        # Updates
        if self.package_data.get('updates'):
            print('\n{}{}Updates:'.format(c.Style.BRIGHT, c.Fore.BLUE))
            for p in self.package_data['updates']:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # Packaging
        print('\n{}{}Package:'.format(c.Style.BRIGHT, c.Fore.BLUE))
        for p in self.package_data['package']:
            if isinstance(p.get('output'), list):
                n = 5
                list_data = p.get('output')
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, ', '.join(p.get('output')[:n])
                    )
                )
                del list_data[:n]
                for data in [
                    list_data[i : i + n] for i in range(0, len(list_data), n)  # noqa: E203
                ]:
                    print(
                        '{!s:<20}{}{} {!s:<50}'.format(
                            '', c.Style.BRIGHT, c.Fore.CYAN, ', '.join(data)
                        )
                    )

            else:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # Bundle
        if self.package_data.get('bundle'):
            print('\n{}{}Bundle:'.format(c.Style.BRIGHT, c.Fore.BLUE))
            for p in self.package_data['bundle']:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # ignore exit code
        if not self.args.ignore_validation:
            print('\n')  # separate errors from normal output
            # print all errors
            for error in self.package_data.get('errors'):
                print('{}{}'.format(c.Fore.RED, error))
                self.exit_code = 1
612521
def info():
    """"""
    print("convenience function for listing prms")
    print(type(prms))
    print(prms.__name__)
    print(f"prm file: {_get_prm_file()}")

    for key in prms.__dict__:
        if isinstance(prms.__dict__[key], box.Box):
            print()
            print(80 * "=")
            print(f"prms.{key}:")
            print(80 * "-")
            for subkey in prms.__dict__[key]:
                print(
                    f"prms.{key}.{subkey} = ",
                    f"{prms.__dict__[key][subkey]}"
                )
            print(80 * "=")
592478
def GetInfo(self):
        """"""
        return {
            'vendor': self.vendor,
            'product': self.product,
            'version': self.version,
            'url': self.url,
            'interfaces': list(self.interfaces.keys())
        }
1198392
def get_packages(session):
    """"""
    resp = session.get(DELIVERIES_URL, params=_get_params(session.auth.locale))
    parsed = BeautifulSoup(resp.text, HTML_PARSER)
    token_elem = parsed.find(TOKEN_FIND_TAG, TOKEN_FIND_ATTR)
    tid_elem = parsed.find(TID_FIND_TAG, TID_FIND_ATTR)
    if not token_elem or not tid_elem:
        raise UPSError('failed to find token or tid')
    token = token_elem.get(VALUE_ATTR)
    tid = tid_elem.get(VALUE_ATTR)
    resp = session.post(SERVICE_URL, {
        'token': token,
        'uid': session.auth.username,
        'callType': 'allShipments',
        'tid': tid,
        'loc': session.auth.locale
    })
    try:
        packages = []
        data = json.loads(resp.text[UPS_JSON_PREAMBLE_SIZE:])
        shipments = data['shipmentContainer']['inboundShipments'] + \
            data['shipmentContainer']['historyShipments']
        for shipment in shipments:
            from_location = '{}, {}, {}'.format(shipment['sfc'],
                                                shipment['sfs'],
                                                shipment['sfcn'])
            estimated_date = _parsed_date(shipment['sddfd'])
            actual_date = _parsed_date(shipment['dd'])
            packages.append({
                'tracking_number': shipment['tn'],
                'status': shipment['sts'],
                'from': shipment['sfn'],
                'from_location': from_location,
                'estimated_delivery_date': estimated_date,
                'estimated_delivery_timeframe': shipment['sdtfd'],
                'delivery_date': actual_date
            })
        return packages
    except JSONDecodeError:
        raise UPSError('failed to parse json')
1252713
def show_ver(**kwargs):
    '''
    
    '''
    command = 'show version'
    info = ''
    info = show(command, **kwargs)
    if isinstance(info, list):
        info = info[0]
    return info
966983
def info(self, *msg):
        
        label = colors.blue("INFO")
        self._msg(label, *msg)
892824
function generatePackageInformation( &$packageInformation, $package, $http, $step, &$persistentData )
    {
        $cssfile = $persistentData['sitecssfile'];
        if ( $cssfile )
            $cssfile = $persistentData['classescssfile'];

        if ( $cssfile )
        {
            $packageInformation['name'] = $cssfile['basename'];
            $packageInformation['summary'] = $cssfile['basename'] . ' site style';
            $packageInformation['description'] = 'A site style called ' . $cssfile['basename'];
        }
    }
413102
def summary(self):
        
        print("\nStatus summary")
        print("=" * 79)
        print("{0}found {1} dependencies in {2} packages.{3}\n".format(
            self.grey, self.count_dep, self.count_pkg, self.endc))
885275
def show_details(self):
        
        res = str(self)
        res += '\nDETAILS\n'
        for f in self.factors:
            res += str(f)

        return res
797816
def parse_info(raw_info, apply_tag=None):
    
    parse_releases(raw_info)
    parse_packages(raw_info, apply_tag=apply_tag)
    return raw_info
372241
def info(self, message, *args, **kwargs):
        """"""
        self.log("info", message, *args, **kwargs)
329566
def get_package_info(package):
    """"""
    url = 'https://pypi.python.org/pypi/{}/json'.format(package)
    r = requests.get(url)
    r.raise_for_status()
    return r.json()
724337
def get_pkg_info(
    package_name, additional=("pip", "flit", "pbr", "setuptools", "wheel")
):
    """"""
    dist_index = build_dist_index(pkg_resources.working_set)
    root = dist_index[package_name]
    tree = construct_tree(dist_index)
    dependencies = {pkg.name: pkg.installed_version for pkg in tree[root]}
    # Add the initial package itself.
    root = root.as_requirement()
    dependencies[root.name] = root.installed_version
    # Retrieve information on additional packages such as build tools.
    for name in additional:
        try:
            pkg = dist_index[name].as_requirement()
            dependencies[pkg.name] = pkg.installed_version
        except KeyError:
            continue
    return dependencies
1212626
def package(self):
        """"""
        return u'{0}-{1}-{2}'.format(self.name,
                                     self.version,
                                     self.release)
1344851
def get_packages(session):
    """"""
    _LOGGER.info("attempting to get package data")
    response = _get_dashboard(session)
    parsed = BeautifulSoup(response.text, HTML_PARSER)
    packages = []
    for row in parsed.find_all('div', {'class': 'pack_row'}):
        packages.append({
            'tracking_number': _get_tracking_number(row),
            'primary_status': _get_primary_status(row),
            'secondary_status': _get_secondary_status(row),
            'status_timestamp': _get_status_timestamp(row),
            'shipped_from': _get_shipped_from(row),
            'delivery_date': _get_delivery_date(row)
        })
    return packages