Example #1
0
 def do_install(self, arguments):
     """install a new module"""
     
     repository = self.__choose_repo()
     
     if repository != None:
         installer = ModuleInstaller(repository)
         modules = installer.install(arguments.options, arguments.force)
                     
         print
         print "Successfully installed %d modules, %d already installed." % (len(modules['success']), len(modules['existing']))
         if len(modules['fail']) > 0:
             print "Failed to install %d modules:" % len(modules['fail'])
             for module in modules['fail']:
                 print "  %s" % module
                 print "    %s" % modules['fail'][module]
         print
Example #2
0
 def __search_remotes(self, term, include_descriptions=False):
     """
     Search for modules, on remote repositories.
     """
     
     installer = ModuleInstaller(None)
     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"