Changeset 757425cfde5a8ac009725515121e7f9570020ace

Show
Ignore:
Timestamp:
01/12/08 18:36:02 (10 months ago)
Author:
William McBrine <wmcbrine@gmail.com>
git-committer:
William McBrine <wmcbrine@gmail.com> 1200184562 -0500
git-parent:

[80d87112c29e1defd21c2ae39354b7db73870413]

git-author:
William McBrine <wmcbrine@gmail.com> 1200184562 -0500
Message:

Use getboolean() where appropriate.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • config.py

    ree1f97f r757425c  
    3232    if config.has_section('_tivo_' + tsn): 
    3333        if config.has_option('_tivo_' + tsn, 'aspect169'): 
    34             if config.get('_tivo_' + tsn, 'aspect169').lower() == 'true'
    35                 return True 
    36             else
    37                 return False     
    38      
     34            try
     35                return config.getboolean('_tivo_' + tsn, 'aspect169') 
     36            except ValueError
     37                pass 
     38 
    3939    if tsn[:3] in BLACKLIST_169: 
    4040        return False 
     
    6666def getDebug(): 
    6767    try: 
    68         debug = config.get('Server', 'debug') 
    69         if debug.lower() == 'true': 
    70             return True 
    71         else: 
    72             return False 
    73     except NoOptionError: 
     68        return config.getboolean('Server', 'debug') 
     69    except NoOptionError, ValueError: 
    7470        return False 
    7571 
    7672def getOptres(): 
    7773    try: 
    78         optres = config.get('Server', 'optres') 
    79         if optres.lower() == 'true': 
    80             return True 
    81         else: 
    82             return False 
    83     except NoOptionError: 
     74        return config.getboolean('Server', 'optres') 
     75    except NoOptionError, ValueError: 
    8476        return False 
    8577 
     
    9082    if tsn and config.has_section('_tivo_' + tsn): 
    9183        try: 
    92             return config.get('_tivo_' + tsn, 'ffmpeg_prams', raw = True) 
    93         except NoOptionError: 
    94             pass 
    95  
    96     try: 
    97         return config.get('Server', 'ffmpeg_prams', raw = True) 
     84            return config.get('_tivo_' + tsn, 'ffmpeg_prams', raw=True) 
     85        except NoOptionError: 
     86            pass 
     87 
     88    try: 
     89        return config.get('Server', 'ffmpeg_prams', raw=True) 
    9890    except NoOptionError: #default 
    9991        return '-vcodec mpeg2video -r 29.97 -b %(video_br)s -maxrate %(max_video_br)s -bufsize %(buff_size)s %(aspect_ratio)s -comment pyTivo.py %(audio_codec)s -ab %(audio_br)s -f vob -' 
  • pyTivoConfigurator.pyw

    r80d8711 r757425c  
    139139 
    140140        if self.config.has_option(name, 'auto_subshares') and \ 
    141            self.config.get(name, 'auto_subshares') == 'True'
     141           self.config.getboolean(name, 'auto_subshares')
    142142            subshares = 1 
    143143        else: