prints package meta data
187668
protected function printMeta(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo)
    {
        $this->getIO()->write('<info>name</info>     : ' . $package->getPrettyName());
        $this->getIO()->write('<info>descrip.</info> : ' . $package->getDescription());
        $this->getIO()->write('<info>keywords</info> : ' . join(', ', $package->getKeywords() ?: array()));
        $this->printVersions($package, $versions, $installedRepo);
        $this->getIO()->write('<info>type</info>     : ' . $package->getType());
        $this->printLicenses($package);
        $this->getIO()->write('<info>source</info>   : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference()));
        $this->getIO()->write('<info>dist</info>     : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference()));
        $this->getIO()->write('<info>names</info>    : ' . implode(', ', $package->getNames()));

        if ($package->isAbandoned()) {
            $replacement = ($package->getReplacementPackage() !== null)
                ? ' The author suggests using the ' . $package->getReplacementPackage(). ' package instead.'
                : null;

            $this->getIO()->writeError(
                sprintf('<warning>Attention: This package is abandoned and no longer maintained.%s</warning>', $replacement)
            );
        }

        if ($package->getSupport()) {
            $this->getIO()->write("\n<info>support</info>");
            foreach ($package->getSupport() as $type => $value) {
                $this->getIO()->write('<comment>' . $type . '</comment> : '.$value);
            }
        }

        if ($package->getAutoload()) {
            $this->getIO()->write("\n<info>autoload</info>");
            foreach ($package->getAutoload() as $type => $autoloads) {
                $this->getIO()->write('<comment>' . $type . '</comment>');

                if ($type === 'psr-0') {
                    foreach ($autoloads as $name => $path) {
                        $this->getIO()->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
                    }
                } elseif ($type === 'psr-4') {
                    foreach ($autoloads as $name => $path) {
                        $this->getIO()->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
                    }
                } elseif ($type === 'classmap') {
                    $this->getIO()->write(implode(', ', $autoloads));
                }
            }
            if ($package->getIncludePaths()) {
                $this->getIO()->write('<comment>include-path</comment>');
                $this->getIO()->write(implode(', ', $package->getIncludePaths()));
            }
        }
    }
924986
def reference(self):
        
        total_enabled = ", ".join(self.selected)
        if len(total_enabled) < 1:
            total_enabled = ("{0}Are you crazy? This is a package "
                             "manager for packages :p{1}".format(
                                 self.meta.color["RED"],
                                 self.meta.color["ENDC"]))
        self.msg.template(78)
        print("| Enabled repositories:")
        self.msg.template(78)
        print("| {0}".format(total_enabled))
        self.msg.template(78)
        print("{0}Total {1}/{2} repositories enabled.{3}\n".format(
            self.meta.color["GREY"], len(self.selected),
            len(self.enabled + self.disabled), self.meta.color["ENDC"]))
823491
def print_dependencies(package_name):
    """"""
    info = get_sys_info()
    print("\nSystem Information")
    print("==================")
    print_info(info)

    info = get_pkg_info(package_name)
    print("\nPackage Versions")
    print("================")
    print_info(info)
567788
def print_build_info(self):
        """"""
        if self.static_extension:
            build_type = "static extension"
        else:
            build_type = "dynamic extension"
        print("Build type: %s" % build_type)
        print("Include path: %s" % " ".join(self.include_dirs))
        print("Library path: %s" % " ".join(self.library_dirs))
        print("Linked dynamic libraries: %s" % " ".join(self.libraries))
        print("Linked static libraries: %s" % " ".join(self.extra_objects))
        print("Extra compiler options: %s" % " ".join(self.extra_compile_args))
        print("Extra linker options: %s" % " ".join(self.extra_link_args))
62299
def print_summary(self, verbose=False, no_color=False):
        ''

        types = {0: 'Unknown',
                 1: 'Extension/Multi-Extension',
                 2: 'Full Theme',
                 3: 'Dictionary',
                 4: 'Language Pack',
                 5: 'Search Provider',
                 7: 'Subpackage',
                 8: 'App'}
        detected_type = types[self.detected_type]

        buffer = StringIO()
        self.handler = OutputHandler(buffer, no_color)

        # Make a neat little printout.
        self.handler.write('\n<<GREEN>>Summary:') \
            .write('-' * 30) \
            .write('Detected type: <<BLUE>>%s' % detected_type) \
            .write('-' * 30)

        if self.failed():
            self.handler.write('<<BLUE>>Test failed! Errors:')

            # Print out all the errors/warnings:
            for error in self.errors:
                self._print_message('<<RED>>Error:<<NORMAL>>\t',
                                    error, verbose)
            for warning in self.warnings:
                self._print_message('<<YELLOW>>Warning:<<NORMAL>> ',
                                    warning, verbose)
        else:
            self.handler.write('<<GREEN>>All tests succeeded!')

        if self.notices:
            for notice in self.notices:
                self._print_message(prefix='<<WHITE>>Notice:<<NORMAL>>\t',
                                    message=notice,
                                    verbose=verbose)

        if 'is_jetpack' in self.metadata and verbose:
            self.handler.write('\n')
            self.handler.write('<<GREEN>>Jetpack add-on detected.<<NORMAL>>\n'
                               'Identified files:')
            if 'jetpack_identified_files' in self.metadata:
                for filename, data in \
                        self.metadata['jetpack_identified_files'].items():
                    self.handler.write((' %s\n' % filename) +
                                       ('  %s : %s' % data))

            if 'jetpack_unknown_files' in self.metadata:
                self.handler.write('Unknown files:')
                for filename in self.metadata['jetpack_unknown_files']:
                    self.handler.write(' %s' % filename)

        self.handler.write('\n')
        if self.unfinished:
            self.handler.write('<<RED>>Validation terminated early')
            self.handler.write('Errors during validation are preventing '
                               'the validation process from completing.')
            self.handler.write('Use the <<YELLOW>>--determined<<NORMAL>> '
                               'flag to ignore these errors.')
            self.handler.write('\n')

        return buffer.getvalue()
360662
def find(self, flag):
        
        matching, pkg_cache, match_cache = 0, "", ""
        print("\nPackages with matching name [ {0}{1}{2} ]\n".format(
            self.meta.color["CYAN"], ", ".join(self.binary),
            self.meta.color["ENDC"]))
        for pkg in self.binary:
            for match in find_package("", self.meta.pkg_path):
                if "--case-ins" in flag:
                    pkg_cache = pkg.lower()
                    match_cache = match.lower()
                else:
                    pkg_cache = pkg
                    match_cache = match
                if pkg_cache in match_cache:
                    matching += 1
                    self._sizes(match)
                    print("[ {0}installed{1} ] [ {2} ] - {3}".format(
                        self.meta.color["GREEN"], self.meta.color["ENDC"],
                        self.file_size, match))
        if matching == 0:
            message = "Can't find"
            self.msg.pkg_not_found("", ", ".join(self.binary), message, "\n")
            raise SystemExit(1)
        else:
            self._calc_sizes()
            print("\nFound summary")
            print("=" * 79)
            print("{0}Total found {1} matching packages.{2}".format(
                self.meta.color["GREY"], matching, self.meta.color["ENDC"]))
            print("{0}Size of installed packages {1} {2}.{3}\n".format(
                self.meta.color["GREY"], round(self.size, 2), self.unit,
                self.meta.color["ENDC"]))
344364
def _view_deps(self, path, package):
        
        self.size = 0
        packages = []
        dependencies = (Utils().read_file(path + package)).splitlines()
        for dep in dependencies:
            if GetFromInstalled(dep).name():
                ver = GetFromInstalled(dep).version()
                packages.append(dep + ver)
            else:
                dependencies.remove(dep)
        if packages:
            if "--checklist" in self.extra:
                deps, dependencies = [], []
                text = "Found dependencies for the package {0}".format(package)
                backtitle = "{0} {1}".format(self.meta.__all__,
                                             self.meta.__version__)
                status = True
                deps = DialogUtil(packages, text, " Remove ", backtitle,
                                  status).checklist()
                for d in deps:
                    dependencies.append("-".join(d.split("-")[:-1]))
                self.meta.remove_deps_answer = "y"
            else:
                print("")   # new line at start
                self.msg.template(78)
                print("| Found dependencies for the package {0}:".format(
                    package))
                self.msg.template(78)
                for pkg in packages:
                    find = find_package(pkg + self.meta.sp, self.meta.pkg_path)
                    self._sizes(find[0])
                    print("| {0}{1}{2}".format(self.meta.color["RED"], pkg,
                                               self.meta.color["ENDC"]))
                self.msg.template(78)
                self._calc_sizes()
                print("| {0}Size of removed dependencies {1} {2}{3}".format(
                    self.meta.color["GREY"], round(self.size, 2), self.unit,
                    self.meta.color["ENDC"]))
                self.msg.template(78)
        return dependencies
934172
def run(self):
        
        self.msg.resolving()
        self.repositories()
        if self.find_pkg:
            self.dependencies_list.reverse()
            self.requires = Utils().dimensional_list(self.dependencies_list)
            self.dependencies = Utils().remove_dbs(self.requires)
            if self.dependencies == []:
                self.dependencies = ["No dependencies"]
            if "--graph=" in self.flag:
                self.deps_tree()
            self.msg.done()
            pkg_len = len(self.name) + 24
            print("")    # new line at start
            self.msg.template(pkg_len)
            print("| Package {0}{1}{2} dependencies :".format(
                self.cyan, self.name, self.endc))
            self.msg.template(pkg_len)
            print("\\")
            print(" +---{0}[ Tree of dependencies ]{1}".format(self.yellow,
                                                               self.endc))
            index = 0
            for pkg in self.dependencies:
                if "--check-deps" in self.flag:
                    used = self.check_used(pkg)
                    self.deps_used(pkg, used)
                    used = "{0} {1}{2}{3}".format(
                        "is dependency -->", self.cyan,
                        ", ".join(used), self.endc)
                else:
                    used = ""
                index += 1
                installed = ""
                if find_package(pkg + self.meta.sp, self.meta.pkg_path):
                    if self.meta.use_colors in ["off", "OFF"]:
                        installed = "* "
                    print(" |")
                    print(" {0}{1}: {2}{3}{4} {5}{6}".format(
                        "+--", index, self.green, pkg,
                        self.endc, installed, used))
                else:
                    print(" |")
                    print(" {0}{1}: {2}{3}{4} {5}".format(
                        "+--", index, self.red, pkg,
                        self.endc, installed))
            if self.meta.use_colors in ["off", "OFF"]:
                print("\n * = Installed\n")
            else:
                print("")    # new line at end
            if "--graph=" in self.flag:
                self.graph()
        else:
            self.msg.done()
            print("\nNo package was found to match\n")
            raise SystemExit(1)
1336608
def _extract_info_from_package(dependency,
                               extract_type=None,
                               debug=False,
                               include_build_requirements=False
                               ):
    
    output_folder = tempfile.mkdtemp(prefix="pythonpackage-metafolder-")
    try:
        extract_metainfo_files_from_package(
            dependency, output_folder, debug=debug
        )

        with open(os.path.join(output_folder, "METADATA"),
                  "r", encoding="utf-8"
                 ) as f:
            # Get metadata and cut away description (is after 2 linebreaks)
            metadata_entries = f.read().partition("\n\n")[0].splitlines()

        if extract_type == "name":
            name = None
            for meta_entry in metadata_entries:
                if meta_entry.lower().startswith("name:"):
                    return meta_entry.partition(":")[2].strip()
            if name is None:
                raise ValueError("failed to obtain package name")
            return name
        elif extract_type == "dependencies":
            requirements = []
            if os.path.exists(os.path.join(output_folder,
                                           'pyproject.toml')
                              ) and include_build_requirements:
                with open(os.path.join(output_folder, 'pyproject.toml')) as f:
                    build_sys = pytoml.load(f)['build-system']
                    if "requires" in build_sys:
                        requirements += build_sys["requires"]

            # Add requirements from metadata:
            requirements += [
                entry.rpartition("Requires-Dist:")[2].strip()
                for entry in metadata_entries
                if entry.startswith("Requires-Dist")
            ]

            return list(set(requirements))  # remove duplicates
    finally:
        shutil.rmtree(output_folder)
149725
def pkg_desc(self):
        
        options = [
            "-p",
            "--desc"
        ]
        flag = ["--color="]
        colors = [
            "red",
            "green",
            "yellow",
            "cyan",
            "grey"
        ]
        tag = ""
        for arg in self.args:
            if arg.startswith(flag[0]):
                tag = arg[len(flag[0]):]
                self.args.remove(arg)
                break
        if tag and tag not in colors:
            print("\nslpkg: Error: Available colors {0}\n".format(
                colors))
            raise SystemExit()
        if (len(self.args) == 3 and self.args[0] in options and
                self.args[1] in self.meta.repositories and tag in colors):
            PkgDesc(self.args[2], self.args[1], tag).view()
        elif (len(self.args) == 3 and self.args[0] in options and
                self.args[1] in self.meta.repositories):
            PkgDesc(self.args[2], self.args[1], paint="").view()
        elif (len(self.args) > 1 and self.args[0] in options and
                self.args[1] not in self.meta.repositories):
            usage(self.args[1])
        else:
            usage("")
146891
def show(self):
        
        self.data()
        print("")
        self.msg.template(78)
        print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
        self.msg.template(78)
        for key, value in self.dmap.iteritems():
            print("  {0}{1}{2}{3}{4}".format(
                self.green, key, self.endc, " " * (32-len(key)),
                ", ".join(value)))
        self.summary()
        if self.image:
            Graph(self.image).dependencies(self.dmap)
71255
def build_package_data(self):
        """"""
        for package, src_dir, build_dir, filenames in self.data_files:
            for filename in filenames:
                target = os.path.join(build_dir, filename)
                self.mkpath(os.path.dirname(target))
                srcfile = os.path.join(src_dir, filename)
                outf, copied = self.copy_file(srcfile, target)
                srcfile = os.path.abspath(srcfile)
                if (copied and
                        srcfile in self.distribution.convert_2to3_doctests):
                    self.__doctests_2to3.append(outf)
938973
def print_all_metadata(fname):
    
    print("Filename   :", fname )
    print("Basename   :", os.path.basename(fname))
    print("Path       :", os.path.dirname(fname))
    print("Size       :", os.path.getsize(fname))
    img = Image.open(fname)
    # get the image's width and height in pixels
    width, height = img.size
    # get the largest dimension
    #max_dim = max(img.size)
    print("Width      :", width)
    print("Height     :", height)
    print("Format     :", img.format)
    print("palette    :", img.palette )
     
    print_stats(img)
    #print_exif_data(img)
    exif_data = get_exif_data(img)
    (lat, lon) = get_lat_lon(exif_data)
    print("GPS Lat    :", lat )
    print("GPS Long   :", lon )
540129
def print_details(self):
		""""""
		print("Title:", self.title)
		print("Category:", self.category)
		print("Page: ", self.page)
		print("Size: ", self.size)
		print("Files: ", self.files)
		print("Age: ", self.age)
		print("Seeds:", self.seeders)
		print("Leechers: ", self.leechers)
		print("Magnet: ", self.magnet)
		print("Download: ", self.download)
		print("Verified:", self.isVerified)
838661
def get_package_data():
    """"""
    BITSIZE, LINKAGE = platform.architecture()
    files = [
        "py.typed",
        "lib/LIBTCOD-CREDITS.txt",
        "lib/LIBTCOD-LICENSE.txt",
        "lib/README-SDL.txt",
    ]
    if "win32" in sys.platform:
        if BITSIZE == "32bit":
            files += ["x86/SDL2.dll"]
        else:
            files += ["x64/SDL2.dll"]
    if sys.platform == "darwin":
        files += ["SDL2.framework/Versions/A/SDL2"]
    return files
758055
def showMetadata(dat):
    
    _tmp = rm_values_fields(copy.deepcopy(dat))
    print(json.dumps(_tmp, indent=2))
    return
618395
def get_and_update_package_metadata():
    
    global setup_arguments
    global METADATA_FILENAME

    if not os.path.exists('.git') and os.path.exists(METADATA_FILENAME):
        with open(METADATA_FILENAME) as fh:
            metadata = json.load(fh)
    else:
        git = Git(version=setup_arguments['version'])
        metadata = {
            'version': git.version,
            'long_description': 'Tool to pip install missing imports and more',
            'git_hash': git.hash,
            'git_origin': git.origin,
            'git_branch': git.branch
        }
        for readme_file in ['README.rst', 'README.md', 'README.txt']:
            if os.path.exists(readme_file):
                with open(readme_file) as file_handle:
                    metadata['long_description'] = file_handle.read()
                break
        with open(METADATA_FILENAME, 'w') as fh:
            json.dump(metadata, fh)
    return metadata