Ejemplo n.º 1
0
 def format(self):
     # print "BoardModels: dir(self) is:"
     # print dir(self)
     map = [(key, val["name"]) for key, val in self.iteritems() if "name" in val]
     # map = [(key, val['name']) for key, val in self.iteritems()]
     print map
     return format_available_options(map, head_width=12, default=self.default)
Ejemplo n.º 2
0
 def format(self):
     #print "BoardModels: dir(self) is:"
     #print dir(self)
     map = [(key, val['name']) for key, val in self.iteritems()
            if 'name' in val]
     #map = [(key, val['name']) for key, val in self.iteritems()]
     print map
     return format_available_options(map,
                                     head_width=12,
                                     default=self.default)
Ejemplo n.º 3
0
    def setup_arg_parser(self, parser):
        super(Init, self).setup_arg_parser(parser)
        parser.add_argument('-t', '--template', default=self.default_template,
                            help='Project template to use')

        parser.epilog = "Available project templates:\n\n"

        template_items = []
        for tdir in list_subdirs(self.e.templates_dir):
            try:
                description = ConfigObj(os.path.join(tdir, 'manifest.ini'))['description']
            except KeyError:
                description = ''
            template_items.append((os.path.basename(tdir), description))

        parser.epilog += format_available_options(template_items, head_width=12,
                                                  default=self.default_template)
Ejemplo n.º 4
0
 def format(self):
     map = [(key, val['name']) for key, val in self.iteritems()]
     return format_available_options(map, head_width=12, default=self.default)
Ejemplo n.º 5
0
 def format(self):
     map = [(key, val['name']) for key, val in self.iteritems()
            if 'name' in val]
     return format_available_options(map,
                                     head_width=12,
                                     default=self.default)
Ejemplo n.º 6
0
 def format(self):
     map = [(key, val['name']) for key, val in self.iteritems()]
     head_width = reduce(lambda a, b: max(a, b), [len(k) for k in self.keys()])
     return format_available_options(map, head_width=head_width, default=self.default)