Changeset ae39ac9f4d53ef3c57ac397c956f075cf52245e7 for httpserver.py
- Timestamp:
- 04/06/08 22:46:43 (9 months ago)
- git-parent:
- Files:
-
- httpserver.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
httpserver.py
r4c2ad03 rae39ac9 7 7 import config 8 8 from xml.sax.saxutils import escape 9 from debug import debug_write, fn_attr 9 import logging 10 10 11 11 SCRIPTDIR = os.path.dirname(__file__) … … 46 46 ip = self.address_string() 47 47 self.tivos[tsn] = ip 48 48 49 49 basepath = unquote_plus(self.path).split('/')[1] 50 50 … … 73 73 (not query.has_key('Container') or query['Container'][0] == '/'): 74 74 self.root_container() 75 return 75 return 76 76 77 77 if query.has_key('Container'): … … 88 88 break 89 89 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 91 91 # anything. 92 92 self.unsupported(query) … … 135 135 t.shares += '<a href="TiVoConnect?Command=QueryContainer&Container=' + section\ 136 136 + '">' + section + '</a><br/>' 137 137 138 138 self.wfile.write(t) 139 139 self.end_headers() … … 141 141 def unsupported(self, query): 142 142 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.') 145 146 command = query['Command'][0] 146 147 plugin = GetPlugin('video') 147 148 if ''.join(query['Filter']).find('video') >= 0 and \ 148 149 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.') 152 151 method = getattr(plugin, command) 153 152 method(self, query)
