Beispiel #1
0
    def search(self, pattern_or_reference=None, remote=None, ignorecase=True, packages_query=None):
        """ Print the single information saved in conan.vars about all the packages
            or the packages which match with a pattern

            Attributes:
                pattern = string to match packages
                remote = search on another origin to get packages info
                packages_pattern = String query with binary
                                   packages properties: "arch=x86 AND os=Windows"
        """
        printer = Printer(self._user_io.out)

        if remote:
            remote_proxy = ConanProxy(self._client_cache, self._user_io, self._remote_manager,
                                      remote)
            adapter = remote_proxy
        else:
            adapter = self._search_manager
        if isinstance(pattern_or_reference, ConanFileReference):
            packages_props = adapter.search_packages(pattern_or_reference, packages_query)
            ordered_packages = OrderedDict(sorted(packages_props.items()))
            try:
                recipe_hash = self._client_cache.load_manifest(pattern_or_reference).summary_hash
            except IOError:  # It could not exist in local
                recipe_hash = None
            printer.print_search_packages(ordered_packages, pattern_or_reference,
                                          recipe_hash, packages_query)
        else:
            references = adapter.search(pattern_or_reference, ignorecase)
            printer.print_search_recipes(references, pattern_or_reference)
Beispiel #2
0
 def print_search_packages(self, ordered_packages, pattern, recipe_hash, packages_query, table):
     if table:
         from conans.client.graph.grapher import html_binary_graph
         html_binary_graph(pattern, ordered_packages, recipe_hash, table)
     else:
         printer = Printer(self.user_io.out)
         printer.print_search_packages(ordered_packages, pattern, recipe_hash, packages_query)
Beispiel #3
0
    def search(self, pattern_or_reference=None, remote=None, ignorecase=True, packages_query=None):
        """ Print the single information saved in conan.vars about all the packages
            or the packages which match with a pattern

            Attributes:
                pattern = string to match packages
                remote = search on another origin to get packages info
                packages_pattern = String query with binary
                                   packages properties: "arch=x86 AND os=Windows"
        """
        printer = Printer(self._user_io.out)

        if remote:
            remote_proxy = ConanProxy(self._client_cache, self._user_io, self._remote_manager,
                                      remote)
            adapter = remote_proxy
        else:
            adapter = self._search_manager
        if isinstance(pattern_or_reference, ConanFileReference):
            packages_props = adapter.search_packages(pattern_or_reference, packages_query)
            ordered_packages = OrderedDict(sorted(packages_props.items()))
            printer.print_search_packages(ordered_packages, pattern_or_reference, packages_query)
        else:
            references = adapter.search(pattern_or_reference, ignorecase)
            printer.print_search_recipes(references, pattern_or_reference)
 def print_search_packages(self, search_info, reference, packages_query, table, raw,
                           template, outdated=False):
     if table:
         html_binary_graph(search_info, reference, table, template)
     else:
         printer = Printer(self._output)
         printer.print_search_packages(search_info, reference, packages_query, raw,
                                       outdated=outdated)
Beispiel #5
0
 def print_search_packages(self, search_info, reference, packages_query, table,
                           outdated=False):
     if table:
         html_binary_graph(search_info, reference, table)
     else:
         printer = Printer(self.user_io.out)
         printer.print_search_packages(search_info, reference, packages_query,
                                       outdated=outdated)
Beispiel #6
0
 def print_search_packages(self, search_info, reference, packages_query,
                           table):
     if table:
         from conans.client.graph.grapher import html_binary_graph
         html_binary_graph(search_info, reference, table)
     else:
         printer = Printer(self.user_io.out)
         printer.print_search_packages(search_info, reference,
                                       packages_query)
Beispiel #7
0
 def print_search_packages(self, ordered_packages, pattern, recipe_hash, packages_query):
     printer = Printer(self.user_io.out)
     printer.print_search_packages(ordered_packages, pattern, recipe_hash, packages_query)