#!/usr/bin/python
# coding: UTF-8
# Rec10 TS Recording Tools
# Copyright (C) 2009 Yukikaze
import ConfigParser
import os
import os.path
mypath = str(os.path.dirname(os.path.abspath(__file__))) + "/"
confp = ConfigParser.SafeConfigParser()
Conf = 'config.ini'
confpath=""
if os.path.exists(os.path.join(mypath,Conf)):
    confpath=os.path.join(mypath,Conf)
elif os.path.exists(os.path.join("/etc","rec10.conf")):
    confpath=os.path.join("/etc","rec10.conf")
elif os.path.exists(os.path.join("/etc/rec10","config.ini")):
    confpath=os.path.join("/etc/rec10","config.ini")
confp.read(confpath)
def getpath(string):
    global confp
    return confp.get('path', string)
def getdbpath(string):
    global confp
    return confp.get('db', string)
def getenv(string):
    global confp
    return confp.get('env', string)
