gmyth-stream/server/0.3/lib/gmsconfig.py
author renatofilho
Tue Aug 21 16:04:44 2007 +0100 (2007-08-21)
branchtrunk
changeset 815 7f290a3a34b1
child 823 8b729aff6f81
permissions -rw-r--r--
[svn r821] created debian packages;\nImplemented server deamon;\n
     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