示例#1
0
文件: report.py 项目: oz123/ctt
    def commandline(cls, args):
        # Report time for all projects
        if args.all:
            projects=ctt.listprojects.ListProjects.list_projects()

        else:
            projects = []
            for x in args.project:
                fnames = glob.glob(os.path.join(ctt.ctt_dir(), x))
                projects.extend(fnames)

        total_time = 0
        for project in projects:
            report = cls(project, args.start, args.end, args.output_format, args.regexp, args.ignore_case)
            report.report()
            total_time = total_time + report.total_time

        cls.summary(total_time)
示例#2
0
    def commandline(cls, args):
        # Report time for all projects
        if args.all:
            projects = ctt.listprojects.ListProjects.list_projects()

        else:
            projects = []
            for x in args.project:
                fnames = glob.glob(os.path.join(ctt.ctt_dir(), x))
                projects.extend(fnames)

        total_time = 0
        reports = collections.OrderedDict()
        for project in projects:
            report = cls(project=project, start_date=args.start,
                         end_date=args.end, output_format=args.output_format,
                         regexp=args.regexp, ignore_case=args.ignore_case)
            report_data = report.report()
            reports[report.project] = (report, report_data)
            total_time = total_time + report.total_time
        cls.print_reports(reports, args.output_format, args.summary)

        cls.summary(total_time)
示例#3
0
文件: report.py 项目: greendeath/ctt
    def commandline(cls, args):
        # Report time for all projects
        if args.all:
            projects=ctt.listprojects.ListProjects.list_projects()

        else:
            projects = []
            for x in args.project:
                fnames = glob.glob(os.path.join(ctt.ctt_dir(), x))
                projects.extend(fnames)

        total_time = 0
        reports = collections.OrderedDict()
        for project in projects:
            report = cls(project=project, start_date=args.start,
                    end_date=args.end, output_format=args.output_format,
                    regexp=args.regexp, ignore_case=args.ignore_case)
            report_data = report.report()
            reports[report.project] = (report, report_data)
            total_time = total_time + report.total_time
        cls.print_reports(reports, args.output_format, args.summary)

        cls.summary(total_time)
示例#4
0
    def list_projects():
        for project in sorted(os.listdir(ctt.ctt_dir())):
            if project[0] == ".":
                continue

            yield project
示例#5
0
 def list_projects():
     for project in ctt.list_projects(ctt.ctt_dir()):
         yield project
示例#6
0
    def list_projects():
        for project in sorted(os.listdir(ctt.ctt_dir())):
            if project[0] == ".":
                continue

            yield project