コード例 #1
0
    args.startdate, args.enddate = fixDates(args.startdate, args.enddate)

    print "Searching between", time.strftime(
        "%a, %d %b %Y %H:%M:%S +0000", time.gmtime(args.startdate)
    ), "-", time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(args.enddate))

    conn = DB.getConn()
    c = conn.cursor()

    c.execute("SELECT * FROM " + DB.repo._table)
    rows = c.fetchall()

    for i in rows:
        r = Repo()
        r.loadFromDatabase(i)
        r.pprint()

        module = -1
        if r.type == Repo.Type.SVN:
            module = svnpuller
        elif r.type == Repo.Type.GIT:
            module = gitpuller

        if module != -1:
            try:
                commits = module.getCommits(r, args.startdate, args.enddate)
            except:
                print "Error pulling commits for", r.url
                commits = []

            for c in commits:
コード例 #2
0
ファイル: cronjob.py プロジェクト: sgmenda/code-peer-review
    print "Searching between", time.strftime(
        "%a, %d %b %Y %H:%M:%S +0000", time.gmtime(
            args.startdate)), "-", time.strftime("%a, %d %b %Y %H:%M:%S +0000",
                                                 time.gmtime(args.enddate))

    conn = DB.getConn()
    c = conn.cursor()

    c.execute("SELECT * FROM " + DB.repo._table)
    rows = c.fetchall()

    for i in rows:
        r = Repo()
        r.loadFromDatabase(i)
        r.pprint()

        module = -1
        if r.type == Repo.Type.SVN:
            module = svnpuller
        elif r.type == Repo.Type.GIT:
            module = gitpuller

        if module != -1:
            try:
                commits = module.getCommits(r, args.startdate, args.enddate)
            except:
                print "Error pulling commits for", r.url
                commits = []

            for c in commits: