Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/csvdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def store_patch(patch):
ChangeSets.append([patch.commit, str(patch.date),
email_encode(patch.email), domain, _author, employer,
patch.added, patch.removed, max(patch.added, patch.removed)])
for (filetype, (added, removed)) in patch.filetypes.iteritems():
for (filetype, (added, removed)) in patch.filetypes.items():
FileTypes.append([patch.commit, filetype, added, removed])


Expand Down
14 changes: 7 additions & 7 deletions src/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def emailemployer (self, email, date):
return empl
# pdb.set_trace()
# If there is a circular alias - this bug will appear!
print 'OOPS. ', self.name, self.employer, self.email, email, date
print('OOPS. ', self.name, self.employer, self.email, email, date)
return None # Should not happen

def addpatch (self, patch):
Expand Down Expand Up @@ -148,7 +148,7 @@ def AllFilesCSV(file, hlist, FileFilter, InvertFilter):
aname = patch.author.name
datestr = str(patch.date)
emplstr = empl.name.replace ('"', '.').replace ('\\', '.')
for (filename, filedata) in patch.files.iteritems():
for (filename, filedata) in patch.files.items():
if filedata[2] == 0:
continue
if FileFilter:
Expand Down Expand Up @@ -186,7 +186,7 @@ def AllAffsCSV(file, hlist):
writer.writerow ([email_encode(email), email_encode(name), emplstr, datestr, source])
for em in ReverseAlias(email):
if em in emails:
print 'This is bad, reverse email already in emails, check: `em`, `email`, `emails`'
print('This is bad, reverse email already in emails, check: `em`, `email`, `emails`')
pdb.set_trace()
writer.writerow ([email_encode(em), email_encode(name), emplstr, datestr, source])

Expand Down Expand Up @@ -305,7 +305,7 @@ def applysplits (self):

def store (self):
if self.name in Employers:
print Employers[self.name]
print(Employers[self.name])
sys.stderr.write ('WARNING: Virtual empl %s overwrites another\n'
% (self.name))
if len (self.splits) == 0:
Expand Down Expand Up @@ -385,7 +385,7 @@ def AddEmailEmployerMapping (email, employer, end = nextyear, domain = False):
for i in range (0, len(l)):
date, xempl, dom = l[i]
if date == end: # probably both nextyear
print 'WARNING: duplicate email/empl for %s' % (email_encode(email))
print('WARNING: duplicate email/empl for %s' % (email_encode(email)))
if date > end:
l.insert (i, (end, empl, domain))
return
Expand Down Expand Up @@ -418,7 +418,7 @@ def MapToEmployer (email, unknown = 0):
pass
namedom = email.split ('@')
if len (namedom) < 2:
print 'Oops...funky email %s' % email_encode(email)
print('Oops...funky email %s' % email_encode(email))
return [(nextyear, GetEmployer ('Funky'), False)]
s = namedom[1].split ('.')
for dots in range (len (s) - 2, -1, -1):
Expand All @@ -437,7 +437,7 @@ def MapToEmployer (email, unknown = 0):
elif unknown == 2:
return [(nextyear, GetEmployer ('(Unknown)'), False)]
else:
print "Unsupported unknown parameter handling value"
print("Unsupported unknown parameter handling value")


def LookupEmployer (email, mapunknown = 0):
Expand Down
18 changes: 9 additions & 9 deletions src/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def ReportByFileType (hacker_list):
by_hacker = {}
for patch in h.patches:
# Get a summary by hacker
for (filetype, (added, removed)) in patch.filetypes.iteritems():
for (filetype, (added, removed)) in patch.filetypes.items():
if filetype in by_hacker:
by_hacker[filetype][patch.ADDED] += added
by_hacker[filetype][patch.REMOVED] += removed
Expand All @@ -557,21 +557,21 @@ def ReportByFileType (hacker_list):
total[filetype] = [added, removed, []]

# Print a summary by hacker
print email_encode(h.full_name_with_aff())
for filetype, counters in by_hacker.iteritems():
print '\t', filetype, counters
print(email_encode(h.full_name_with_aff()))
for filetype, counters in by_hacker.items():
print('\t', filetype, counters)
h_added = by_hacker[filetype][patch.ADDED]
h_removed = by_hacker[filetype][patch.REMOVED]
total[filetype][2].append ([h.full_name_with_aff(), h_added, h_removed])

# Print the global summary
BeginReport ('Contributions by type and developers')
for filetype, (added, removed, hackers) in total.iteritems():
print filetype, added, removed
for filetype, (added, removed, hackers) in total.items():
print(filetype, added, removed)
for h, h_added, h_removed in hackers:
print email_encode('\t%s: [%d, %d]' % (h, h_added, h_removed))
print(email_encode('\t%s: [%d, %d]' % (h, h_added, h_removed)))

# Print the very global summary
BeginReport ('General contributions by type')
for filetype, (added, removed, hackers) in total.iteritems():
print filetype, added, removed
for filetype, (added, removed, hackers) in total.items():
print(filetype, added, removed)