def guess_project_type(self, project_name): # if cwd is under project_dir, look there too # and combine the lists by priority with dedupe pdir = self.project_map[project_name] subdir = os.getcwd() if abspath(subdir).startswith(abspath(pdir)): fine = guess_dir_type(subdir) else: fine = [] coarse = guess_dir_type(pdir) tmp = fine + [x for x in coarse if x not in fine] return tmp
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()