configfile.py

changeset 76
a2fe9ba3041a
parent 73
d67cc4fbc3f1
child 118
dbf49689af0d
equal deleted inserted replaced
75:1818d56c8ff5 76:a2fe9ba3041a
53 53
54 with open ('cobalt.json', 'w') as fp: 54 with open ('cobalt.json', 'w') as fp:
55 json.dump (self.obj, fp, sort_keys = True, indent = 1) 55 json.dump (self.obj, fp, sort_keys = True, indent = 1)
56 56
57 print "Config saved." 57 print "Config saved."
58
59 def find_developer_by_email (self, commit_email):
60 for developer, emails in self.get_value ('developer_emails', default={}).iteritems():
61 if commit_email in emails:
62 return developer
63
64 return ''
58 65
59 def init(): 66 def init():
60 print 'Loading configuration...' 67 print 'Loading configuration...'
61 68
62 try: 69 try:

mercurial