Subversion Repositories SmartDukaan

Rev

Rev 14155 | Blame | Compare with Previous | Last modification | View Log | RSS feed

'''
Created on Feb 25, 2015

@author: amit
'''
#!/usr/bin/python    
import ConfigParser
import os
config = ConfigParser.RawConfigParser()
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
config.read(os.path.join(__location__, 'ConfigFile.properties'))
try:
    ENV = os.environ["ENV"]
    if not ENV:
        ENV = "LOCAL"
except:
    ENV = "DEFAULT"

def getConfig(propertyName):
    global config
    value = config.get(ENV, propertyName)
    if value is None:
        return config.get('DEFAULT', propertyName)
    return value

def main():
    print getConfig('WALLET_CREDIT_URL')

if __name__ == '__main__':
    main()