gmyth-stream/server/lib/gmsconfig.py
author renatofilho
Mon Sep 03 22:11:54 2007 +0100 (2007-09-03)
branchtrunk
changeset 839 5930595a2ae5
parent 824 e711a64ba03d
permissions -rw-r--r--
[svn r845] moved mythsrc to gstreamer cvs
     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