gmyth-stream/server/0.3/lib/gmsconfig.py
author melunko
Wed Aug 22 14:57:53 2007 +0100 (2007-08-22)
branchtrunk
changeset 821 411a01dfcd21
child 823 8b729aff6f81
permissions -rw-r--r--
[svn r827] GMyth 0.4 release
     1 #!/usr/bin/env
     2 
     3 __author__ = "Renato Araujo Oliveira Filho"
     4 __author_email__ = "renato.filho@indt.org.br"
     5 __license__ = "GPL"
     6 __version__ = "0.3"
     7 
     8 
     9 import os
    10 import ConfigParser
    11 
    12 __all__ = ("GmsConfig")
    13 
    14 class GmsConfig:
    15     config = ConfigParser.ConfigParser()
    16     __CONFIG_FILE__ = "server.conf"
    17 
    18     def __init__(self):
    19         file_name = os.path.join (os.path.expanduser("~"), ".gms", self.__CONFIG_FILE__)
    20         print "test config file: %s" % file_name
    21         if os.path.exists (file_name):
    22             fp = open (file_name, "r")
    23             self.config.readfp (fp)
    24             return
    25 
    26         file_name = os.path.join ("/", "etc", "gms", self.__CONFIG_FILE__)
    27         print "test config file: %s" % file_name
    28         if os.path.exists (file_name):
    29             fp = open (file_name, "r")
    30             self.config.readfp (fp)
    31             return
    32     # __init__()
    33 
    34     def get_transcoded_location (self):
    35         try:
    36             return self.config.get("PATHS", "transcoded")
    37         except:
    38             return None
    39     # get_transcoded_location()
    40 
    41 
    42 # GmsConfig