Ejemplo n.º 1
0
 def perform_operation(self, name, op_name):
     self.report("{0}: {1}".format(op_name, name))
     self._require_project(name)
     _dir = self.project_map[name]
     step_guesser = getattr(self, '_guess_{0}_steps'.format(op_name))
     default = step_guesser(name, _dir)
     op_steps = getattr(self, '{0}_map'.format(op_name)).get(name, default)
     results = []
     for fxn in op_steps:
         results.append([fxn, fxn()])
         if not op_steps.index(fxn) == len(op_steps) - 1:
             console.draw_line()
     self.publish('post_operation', op_name, name)
     return dict(results)
Ejemplo n.º 2
0
def summarize(parameter_s=''):
    _dir = parameter_s or os.getcwd()
    assert ope(_dir)
    tmp = guess_dir_type(_dir)
    print console.red('match types:')
    console.draw_line()
    print ' {0}'.format(tmp)
    print console.red('virttualenvs:')
    console.draw_line()
    print ' {0}'.format(find_venvs(_dir))
    print console.red('sloccount:')
    for report_section in sloccount(_dir):
        console.draw_line()
        print report_section.strip()
    console.draw_line()