Subversion Repositories SmartDukaan

Rev

Rev 14154 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14154 Rev 14155
Line 5... Line 5...
5
'''
5
'''
6
#!/usr/bin/python    
6
#!/usr/bin/python    
7
import ConfigParser
7
import ConfigParser
8
import os
8
import os
9
config = ConfigParser.RawConfigParser()
9
config = ConfigParser.RawConfigParser()
10
config.read('./ConfigFile.properties')
-
 
11
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
10
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
12
config.read(os.path.join(__location__, 'ConfigFile.properties'))
11
config.read(os.path.join(__location__, 'ConfigFile.properties'))
13
 
12
 
14
def getConfig(propertyName):
13
def getConfig(propertyName):
15
    global config
14
    global config
16
    value = config.get('PROD', propertyName)
15
    value = config.get('LOCAL', propertyName)
17
    if value is None:
16
    if value is None:
18
        return config.get('DEFAULT', propertyName)
17
        return config.get('DEFAULT', propertyName)
19
    return value
18
    return value
20
 
19
 
21
def main():
20
def main():