Changeset 0a337559fdb9b05ffb86e6483b94ccb79b1a076e

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

[cb23b422179e7bb9b29711404178b3a51bb68e4e], [16a0f4539b8154b6a3876252260004f2614c07da]

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

Merge git://repo.or.cz/pyTivo/krkeegan

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • httpserver.py

    rcb23b42 r0a33755  
    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): 
     
    8285                            method = getattr(plugin, command) 
    8386                            method(self, query) 
     87                            return 
    8488                        else: 
    8589                            self.unsupported(query) 
     90                            return 
    8691                        break 
     92     
     93            #if we made it here it means we couldn't match the request to anything. 
     94            self.unsupported(query) 
     95            return 
    8796        else: 
    8897            self.unsupported(query) 
     
    93102         tsncontainers = {} 
    94103         for section, settings in tsnshares: 
    95             settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
    96             tsncontainers[section] = settings 
     104             try: 
     105                settings['content_type'] = GetPlugin(settings['type']).CONTENT_TYPE 
     106                tsncontainers[section] = settings 
     107             except: 
     108                 None 
    97109         t = Template(file=os.path.join(SCRIPTDIR, 'templates', 
    98110                                        'root_container.tmpl')) 
  • plugins/photo/photo.py

    re8d346b rda1a584  
    2525# Version 0.1,  Dec. 7, 2007 
    2626 
    27 import os, re, random, urllib, threading, time, cgi 
    28 import Image 
     27import os, re, random, urllib, threading, time, cgi, sys 
     28try: 
     29    import Image 
     30except ImportError: 
     31    print 'Photo Plugin Error: The python Imaging Library is not installed' 
     32    sys.exit(1) 
    2933from cStringIO import StringIO 
    3034from Cheetah.Template import Template