Changeset c58e7138fe5ba6af8da8a973003ed1a8371645ad

Show
Ignore:
Timestamp:
02/22/08 20:47:46 (11 months ago)
Author:
William McBrine <wmcbrine@gmail.com>
git-committer:
William McBrine <wmcbrine@gmail.com> 1203734866 -0500
git-parent:

[7fe464c204fc54311de526c631d623353cc17c16]

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

Even better, print an error message; consolidate the unsupported() calls;
spacing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • httpserver.py

    r7fe464c rc58e713  
    8787                            return 
    8888                        else: 
    89                             self.unsupported(query) 
    90                             return 
    91                         break 
    92      
    93             #if we made it here it means we couldn't match the request to anything. 
    94             self.unsupported(query) 
    95             return 
    96         else: 
    97             self.unsupported(query) 
     89                            break 
     90 
     91        # If we made it here it means we couldn't match the request to  
     92        # anything. 
     93        self.unsupported(query) 
    9894 
    9995    def root_container(self): 
    100          tsn = self.headers.getheader('TiVo_TCD_ID', '') 
    101          tsnshares = config.getShares(tsn) 
    102          tsncontainers = {} 
    103          for section, settings in tsnshares: 
    104              try: 
    105                 settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
     96        tsn = self.headers.getheader('TiVo_TCD_ID', '') 
     97        tsnshares = config.getShares(tsn) 
     98        tsncontainers = {} 
     99        for section, settings in tsnshares: 
     100            try: 
     101                settings['content_type'] = \ 
     102                    GetPlugin(settings['type']).CONTENT_TYPE 
    106103                tsncontainers[section] = settings 
    107             except
    108                 pass 
    109         t = Template(file=os.path.join(SCRIPTDIR, 'templates', 
    110                                         'root_container.tmpl')) 
    111         t.containers = tsncontainers 
    112         t.hostname = socket.gethostname() 
    113         t.escape = escape 
    114         self.send_response(200) 
    115         self.end_headers() 
    116         self.wfile.write(t) 
     104            except Exception, msg
     105                print section, '-', msg 
     106        t = Template(file=os.path.join(SCRIPTDIR, 'templates', 
     107                                       'root_container.tmpl')) 
     108        t.containers = tsncontainers 
     109        t.hostname = socket.gethostname() 
     110        t.escape = escape 
     111        self.send_response(200) 
     112        self.end_headers() 
     113        self.wfile.write(t) 
    117114 
    118115    def infopage(self):