Skip to content

Commit

Permalink
make sure that all the prs are either closed or merged in the csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar authored and gudrutis committed Aug 21, 2018
1 parent cfed6ad commit fba5392
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions process-pr-stats
Expand Up @@ -5,6 +5,7 @@ from os.path import exists, expanduser
from os import makedirs, rename, remove
from datetime import datetime
from time import mktime
import re

DIRECTORY_NAME = "data/stats/prs/"

Expand Down Expand Up @@ -104,6 +105,7 @@ if __name__ == "__main__":
pass

# checking if csv file exist
REnotcomp= re.compile('^\d+,NA,.+')
for i in xrange(0, 10000):
beforeBegin = []
filename = DIRECTORY_NAME + "%s.csv" % i
Expand All @@ -114,8 +116,14 @@ if __name__ == "__main__":
if len(lines) != 32:
print filename + " is too short."
elif lines[0] == schema:
print "%s exists and has the same schema, skipping." % filename
continue
all_comp = True
for l in lines:
if REnotcomp.match(l):
all_comp = False
break
if all_comp:
print "%s exists and has the same schema, skipping." % filename
continue
try:
page = iterator.get_page(i)
except:
Expand Down

0 comments on commit fba5392

Please sign in to comment.