diff -r 000000000000 -r 1627de49faa2 gmyth-stream/server/0.3/lib/gmsconfig.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/server/0.3/lib/gmsconfig.py Wed Aug 22 14:07:49 2007 +0100 @@ -0,0 +1,42 @@ +#!/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" + + def __init__(self): + file_name = os.path.join (os.path.expanduser("~"), ".gms", self.__CONFIG_FILE__) + print "test config file: %s" % file_name + if os.path.exists (file_name): + fp = open (file_name, "r") + self.config.readfp (fp) + return + + file_name = os.path.join ("/", "etc", "gms", self.__CONFIG_FILE__) + print "test config file: %s" % file_name + if os.path.exists (file_name): + fp = open (file_name, "r") + self.config.readfp (fp) + return + # __init__() + + def get_transcoded_location (self): + try: + return self.config.get("PATHS", "transcoded") + except: + return None + # get_transcoded_location() + + +# GmsConfig