コード例 #1
0
    def __search_remotes(self, term, include_descriptions=False):
        """
        Search for modules, on remote repositories.
        """

        installer = ModuleInstaller(None)

        try:
            modules = installer.search_index(term)

            if len(modules) > 0:
                for module in modules:
                    print module

                    if include_descriptions:
                        if module.description != None:
                            print "%s\n" % text.indent(
                                text.wrap(module.description,
                                          console.get_size()[0] - 4), "    ")
                        else:
                            print text.indent("No description given.\n",
                                              "    ")
                print
            else:
                print "No modules found.\n"
        except NetworkException:
            print "There was a problem accessing one-or-more of the remote repositories.\n\nMake sure that you have a working network connection.\n"
コード例 #2
0
ファイル: manager.py プロジェクト: 0xr0ot/drozer
    def __search_remotes(self, term, include_descriptions=False):
        """
        Search for modules, on remote repositories.
        """
        
        installer = ModuleInstaller(None)

        try:
            modules = installer.search_index(term)
            
            if len(modules) > 0:
                for module in modules:
                    print module
                    
                    if include_descriptions:
                        if module.description != None:
                            print "%s\n" % text.indent(text.wrap(module.description, console.get_size()[0] - 4), "    ")
                        else:
                            print text.indent("No description given.\n", "    ")
                print
            else:
                print "No modules found.\n"
        except NetworkException:
            print "There was a problem accessing one-or-more of the remote repositories.\n\nMake sure that you have a working network connection.\n"