OSDN Git Service

change function name.
[rec10/rec10-git.git] / rec10 / trunk / src / configwriter.py
1 #!/usr/bin/python
2 # coding: UTF-8
3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009-2010 Yukikaze
5 import ConfigParser
6 import os
7 import os.path
8 mypath = str(os.path.dirname(os.path.abspath(__file__)))
9 confp = ConfigParser.SafeConfigParser()
10 Conf = 'rec10.conf'
11 confpath=os.path.join(mypath,Conf)
12 confp.read(confpath)
13 def getPathSetting(string):
14     global confp
15     return confp.get('path', string)
16 def getDBPathSetting(string):
17     global confp
18     return confp.get('db', string)
19 def getEnvSetting(string):
20     global confp
21     return confp.get('env', string)
22 def setPath(option,value):
23     global confp
24     return confp.set('path',option,value)
25 def setDBPath(option,value):
26     global confp
27     return confp.set('db',option,value)
28 def setEnv(option,value):
29     global confp
30     return confp.set('env',option,value)
31 def writeConf():
32     global confp
33     f=open(confpath,"w")
34     confp.write(f)
35     f.close