Show
Ignore:
Timestamp:
04/06/08 22:46:43 (9 months ago)
Author:
Jason Michalski <armooo@armooo.net>
git-committer:
Jason Michalski <armooo@armooo.net> 1207540003 -0500
git-parent:

[7b28990b5af30df5f624c94e39699cec8839543a]

git-author:
Jason Michalski <armooo@armooo.net> 1207540003 -0500
Message:

Everything is loging with the logging module

Currently everything is always in debug mode

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • httpserver.py

    r4c2ad03 rae39ac9  
    77import config 
    88from xml.sax.saxutils import escape 
    9 from debug import debug_write, fn_attr 
     9import logging 
    1010 
    1111SCRIPTDIR = os.path.dirname(__file__) 
     
    4646        ip = self.address_string() 
    4747        self.tivos[tsn] = ip 
    48                 
     48 
    4949        basepath = unquote_plus(self.path).split('/')[1] 
    5050 
     
    7373               (not query.has_key('Container') or query['Container'][0] == '/'): 
    7474                self.root_container() 
    75                 return  
     75                return 
    7676 
    7777            if query.has_key('Container'): 
     
    8888                            break 
    8989 
    90         # If we made it here it means we couldn't match the request to  
     90        # If we made it here it means we couldn't match the request to 
    9191        # anything. 
    9292        self.unsupported(query) 
     
    135135                t.shares += '<a href="TiVoConnect?Command=QueryContainer&Container=' + section\ 
    136136                    + '">' +  section + '</a><br/>' 
    137          
     137 
    138138        self.wfile.write(t) 
    139139        self.end_headers() 
     
    141141    def unsupported(self, query): 
    142142        if hack83 and 'Command' in query and 'Filter' in query: 
    143             debug_write(__name__, fn_attr(), ['Unsupported request,', 
    144                          'checking to see if it is video.']) 
     143            logger = logging.getLogger('pyTivo.hack83') 
     144 
     145            logger.debug('Unsupported request checking to see if it is video.') 
    145146            command = query['Command'][0] 
    146147            plugin = GetPlugin('video') 
    147148            if ''.join(query['Filter']).find('video') >= 0 and \ 
    148149               hasattr(plugin, command): 
    149                 debug_write(__name__, fn_attr(), ['Unsupported request,', 
    150                              'yup it is video', 
    151                              'send to video plugin for it to sort out.']) 
     150                logger.debug('Unsupported request yup it is video send to video plugin for it to sort out.') 
    152151                method = getattr(plugin, command) 
    153152                method(self, query)