| author | renatofilho |
| Tue Sep 18 18:20:50 2007 +0100 (2007-09-18) | |
| branch | trunk |
| changeset 852 | 2498e4f8c758 |
| parent 824 | e711a64ba03d |
| permissions | -rw-r--r-- |
| renatofilho@815 | 1 |
#!/usr/bin/env |
| renatofilho@815 | 2 |
|
| renatofilho@815 | 3 |
__author__ = "Renato Araujo Oliveira Filho" |
| renatofilho@815 | 4 |
__author_email__ = "renato.filho@indt.org.br" |
| renatofilho@815 | 5 |
__license__ = "GPL" |
| renatofilho@815 | 6 |
__version__ = "0.3" |
| renatofilho@815 | 7 |
|
| renatofilho@815 | 8 |
|
| renatofilho@815 | 9 |
import os |
| renatofilho@815 | 10 |
import ConfigParser |
| renatofilho@815 | 11 |
|
| renatofilho@815 | 12 |
__all__ = ("GmsConfig")
|
| renatofilho@815 | 13 |
|
| renatofilho@815 | 14 |
class GmsConfig: |
| renatofilho@815 | 15 |
config = ConfigParser.ConfigParser() |
| renatofilho@815 | 16 |
__CONFIG_FILE__ = "server.conf" |
| renatofilho@823 | 17 |
__CONFIG_DIRS__ = [os.path.join (os.path.expanduser("~"), ".gms"), \
|
| renatofilho@823 | 18 |
os.path.join ("/", "etc", "gms"), \
|
| melunko@824 | 19 |
"."] |
| renatofilho@815 | 20 |
|
| renatofilho@815 | 21 |
def __init__(self): |
| renatofilho@823 | 22 |
for path in self.__CONFIG_DIRS__: |
| renatofilho@823 | 23 |
file_name = os.path.join (path, self.__CONFIG_FILE__) |
| renatofilho@823 | 24 |
if os.path.exists (file_name): |
| renatofilho@823 | 25 |
fp = open (file_name, "r") |
| renatofilho@823 | 26 |
self.config.readfp (fp) |
| renatofilho@823 | 27 |
return |
| renatofilho@815 | 28 |
# __init__() |
| renatofilho@815 | 29 |
|
| renatofilho@815 | 30 |
def get_transcoded_location (self): |
| renatofilho@815 | 31 |
try: |
| melunko@824 | 32 |
return os.path.realpath (self.config.get("PATHS", "transcoded"))
|
| renatofilho@815 | 33 |
except: |
| renatofilho@815 | 34 |
return None |
| renatofilho@815 | 35 |
# get_transcoded_location() |
| renatofilho@815 | 36 |
|
| renatofilho@815 | 37 |
|
| renatofilho@815 | 38 |
# GmsConfig |