-
Notifications
You must be signed in to change notification settings - Fork 1
/
configReader.py
42 lines (37 loc) · 1.65 KB
/
configReader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import ConfigParser
class configReader(object):
def __init__(self,path):
self.path = path
self.cf = ConfigParser.ConfigParser()
self.cf.read(self.path)
def get_bitbucket(self):
bitbucket={};
bitbucket['password'] = self.cf.get('BITBUCKET','PASSWORD')
bitbucket['username'] = self.cf.get('BITBUCKET','USERNAME')
bitbucket['url'] = self.cf.get('BITBUCKET','URL')
bitbucket['project'] = self.cf.get('BITBUCKET','PROJ')
bitbucket['repo'] = self.cf.get('BITBUCKET','REPO')
return bitbucket
def get_db(self):
database={}
database['dbName'] = self.cf.get('DATABASE','DB_NAME')
database['collName_PR'] = self.cf.get('DATABASE','collName_PR')
database['collName_PR2'] = self.cf.get('DATABASE','collName_PR2')
database['collName_git'] = self.cf.get('DATABASE','collName_git')
database['collName_result'] = self.cf.get('DATABASE','collName_result')
return database
def get_git(self):
gitconfig={}
gitconfig['submodule'] = self.cf.get('GIT','SUBMODULE').split(',')
gitconfig['tagpattern'] = self.cf.get('GIT','TAGPATTERN').split(',')
gitconfig['ignoreauthor'] = self.cf.get('GIT','IGNOREAUTHOR').split(',')
gitconfig['path'] = self.cf.get('GIT','PATH')
return gitconfig
def get_engineerList(self):
engineerList =[];
nameList = self.cf.options("ENGINEERLIST")
for name in nameList:
alias = self.cf.get('ENGINEERLIST',name)
engineer = {'name':name,'alias':alias}
engineerList.append(engineer)
return engineerList