Subversion Repositories SmartDukaan

Rev

Rev 14155 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14155 Rev 16662
Line 7... Line 7...
7
import ConfigParser
7
import ConfigParser
8
import os
8
import os
9
config = ConfigParser.RawConfigParser()
9
config = ConfigParser.RawConfigParser()
10
__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__)))
11
config.read(os.path.join(__location__, 'ConfigFile.properties'))
11
config.read(os.path.join(__location__, 'ConfigFile.properties'))
-
 
12
try:
-
 
13
    ENV = os.environ["ENV"]
-
 
14
    if not ENV:
-
 
15
        ENV = "LOCAL"
-
 
16
except:
-
 
17
    ENV = "DEFAULT"
12
 
18
 
13
def getConfig(propertyName):
19
def getConfig(propertyName):
14
    global config
20
    global config
15
    value = config.get('LOCAL', propertyName)
21
    value = config.get(ENV, propertyName)
16
    if value is None:
22
    if value is None:
17
        return config.get('DEFAULT', propertyName)
23
        return config.get('DEFAULT', propertyName)
18
    return value
24
    return value
19
 
25
 
20
def main():
26
def main():