-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmasters_project_config.py
31 lines (24 loc) · 1.04 KB
/
masters_project_config.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
import ConfigParser
import os.path
PROJECTDIR = os.path.dirname(os.path.abspath(__file__))
if os.path.isfile(PROJECTDIR + '/masters_project.cfg'):
CONFIGFILE = PROJECTDIR + '/masters_project.cfg'
else:
CONFIGFILE = PROJECTDIR + '/masters_project-default.cfg'
#print CONFIGFILE
config = ConfigParser.ConfigParser()
config.read(CONFIGFILE)
DATA_PREFIX = config.get('general', 'DATA_PREFIX')
def getdoclist(filename):
f = open(filename)
l = f.read().splitlines()
f.close()
return l
DOCLIST_TRAINSET = getdoclist(DATA_PREFIX + config.get('doclist', 'PATH') +
'/' + config.get('doclist', 'TRAINSET'))
DOCLIST_TESTSET = getdoclist(DATA_PREFIX + config.get('doclist', 'PATH') + '/' + config.get('doclist', 'TESTSET'))
try:
DOCLIST_DEVTRAINSET = getdoclist(DATA_PREFIX + config.get('doclist', 'DEVPATH') + '/' + config.get('doclist', 'DEVTRAINSET'))
DOCLIST_DEVTESTSET = getdoclist(DATA_PREFIX + config.get('doclist', 'DEVPATH') + '/' + config.get('doclist', 'DEVTESTSET'))
except:
print "feil"