gmyth-stream/server/lib/gmsconfig.py
author renatofilho
Mon Oct 08 19:17:47 2007 +0100 (2007-10-08)
branchtrunk
changeset 858 ebd3aaff20e0
parent 824 e711a64ba03d
permissions -rw-r--r--
[svn r864] fixed bug on uri without port
     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     __CONFIG_DIRS__ =  [os.path.join (os.path.expanduser("~"), ".gms"), \
    18                        os.path.join ("/", "etc", "gms"), \
    19 		       "."]
    20 
    21     def __init__(self):
    22         for path in self.__CONFIG_DIRS__:
    23             file_name = os.path.join (path, self.__CONFIG_FILE__)
    24             if os.path.exists (file_name):
    25                 fp = open (file_name, "r")
    26                 self.config.readfp (fp)
    27                 return
    28     # __init__()
    29 
    30     def get_transcoded_location (self):
    31         try:
    32             return os.path.realpath (self.config.get("PATHS", "transcoded"))
    33         except:
    34             return None
    35     # get_transcoded_location()
    36 
    37 
    38 # GmsConfig