diff -r e711a64ba03d -r 337aef39e86a gmyth-stream/server/lib/gmsconfig.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/server/lib/gmsconfig.py Mon Feb 25 14:14:29 2008 +0000 @@ -0,0 +1,38 @@ +#!/usr/bin/env + +__author__ = "Renato Araujo Oliveira Filho" +__author_email__ = "renato.filho@indt.org.br" +__license__ = "GPL" +__version__ = "0.3" + + +import os +import ConfigParser + +__all__ = ("GmsConfig") + +class GmsConfig: + config = ConfigParser.ConfigParser() + __CONFIG_FILE__ = "server.conf" + __CONFIG_DIRS__ = [os.path.join (os.path.expanduser("~"), ".gms"), \ + os.path.join ("/", "etc", "gms"), \ + "."] + + def __init__(self): + for path in self.__CONFIG_DIRS__: + file_name = os.path.join (path, self.__CONFIG_FILE__) + if os.path.exists (file_name): + fp = open (file_name, "r") + self.config.readfp (fp) + return + # __init__() + + def get_transcoded_location (self): + try: + return os.path.realpath (self.config.get("PATHS", "transcoded")) + except: + return None + # get_transcoded_location() + + +# GmsConfig