Changeset 496f6c35599b4e4e36de1bc6d75ad66f0e3d3cb7

Show
Ignore:
Timestamp:
02/22/08 16:47:38 (11 months ago)
Author:
KRKeegan <-NOSPAM-kevin@krkeegan.com>
git-committer:
KRKeegan <-NOSPAM-kevin@krkeegan.com> 1203720458 -0800
git-parent:

[da1a584094dfb0b9d6e3b7a9cfb0ab1be9f66620]

git-author:
KRKeegan <-NOSPAM-kevin@krkeegan.com> 1203720458 -0800
Message:

Gracefully handle bad containers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • httpserver.py

    r07baf4f r496f6c3  
    3434        if self.containers.has_key(name) or name == 'TiVoConnect': 
    3535            raise "Container Name in use" 
    36         settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
    37         self.containers[name] = settings 
     36        try: 
     37            settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
     38            self.containers[name] = settings 
     39        except KeyError: 
     40            print 'Unable to add container', name 
    3841 
    3942class TivoHTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler): 
     
    9295         tsncontainers = {} 
    9396         for section, settings in tsnshares: 
    94             settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
    95             tsncontainers[section] = settings 
     97             try: 
     98                settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
     99                tsncontainers[section] = settings 
     100             except: 
     101                 None 
    96102         t = Template(file=os.path.join(SCRIPTDIR, 'templates', 
    97103                                        'root_container.tmpl'))