From 669c6641fca4a0d2ce8ac77d287b08dab90c757d Mon Sep 17 00:00:00 2001 From: William McBrine Date: Thu, 19 Feb 2009 06:24:06 -0500 Subject: [PATCH] Restore the ability to define most options in the "Server" section. (The new sections take precedence if present.) --- config.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 4736bef..41a79bd 100644 --- a/config.py +++ b/config.py @@ -121,7 +121,11 @@ def getOptres(tsn=None): try: return config.getboolean(section_name, 'optres') except NoOptionError, ValueError: - return False + pass + try: + return config.getboolean('Server', 'optres') + except NoOptionError, ValueError: + return False def getPixelAR(ref): if config.has_option('Server', 'par'): @@ -217,6 +221,11 @@ def getTivoHeight(tsn): return nearestTivoHeight(height) except NoOptionError: pass + try: + width = config.getint('Server', 'height') + return nearestTivoHeight(height) + except NoOptionError: + pass return [480, 720][isHDtivo(tsn)] def getTivoWidth(tsn): @@ -233,6 +242,11 @@ def getTivoWidth(tsn): return nearestTivoWidth(width) except NoOptionError: pass + try: + width = config.getint('Server', 'width') + return nearestTivoWidth(width) + except NoOptionError: + pass return [544, 1280][isHDtivo(tsn)] def _trunc64(i): @@ -273,6 +287,10 @@ def getVideoPCT(tsn=None): return config.getfloat(section_name, 'video_pct') except NoOptionError: pass + try: + return config.getfloat('Server', 'video_pct') + except NoOptionError: + pass return 85 def getBuffSize(tsn=None): @@ -303,6 +321,10 @@ def get_tsn(name, tsn=None): return config.get(section_name, name) except NoOptionError: pass + try: + return config.get('Server', name) + except NoOptionError: + pass return None def getAudioCodec(tsn=None): -- 2.11.4.GIT