[Subversion] / WebHaiku / web_haiku.py  

Diff of /WebHaiku/web_haiku.py

Parent Directory | Revision Log

version 2265, Sun Jan 14 19:21:59 2007 UTC version 2266, Sun Jan 14 21:00:12 2007 UTC
Line 244 
Line 244 
   
   
   
       URL = property(lambda self: application_uri(self.environ))
   
     def go(self):      def go(self):
         name = shift_path_info(self.environ)          name = shift_path_info(self.environ)
         if name:          if name:
             return self.handle_child(name)              return self.handle_child(name)
   
         url = application_uri(self.environ).rstrip('/')          url = self.URL.rstrip('/')
         leaf = not self.sub_pages and type(self).handle_child == Page.handle_child          leaf = not self.sub_pages and type(self).handle_child == Page.handle_child
   
         if name=='':    # trailing /          if name=='':    # trailing /
Line 283 
Line 285 
   
   
   
   
   
     def invoke_method(self):      def invoke_method(self):
         rm = self.environ['REQUEST_METHOD']          rm = self.environ['REQUEST_METHOD']
         if rm=='HEAD' or rm in self.http_methods:          if rm=='HEAD' or rm in self.http_methods:
Line 414 
Line 414 
         """Override this in a subclass to return a DBAPI connection object"""          """Override this in a subclass to return a DBAPI connection object"""
         raise NotImplementedError          raise NotImplementedError
   
     def query(self, *args, **kw):      def cursor(self, *args, **kw):
         """Create and return a cursor (after optionally running a query on it)          """Create and return a cursor (after optionally running a query on it)
   
         If positional arguments are supplied, they're passed to the cursor's          If positional arguments are supplied, they're passed to the cursor's
Line 435 
Line 435 
   
         return cursor          return cursor
   
       def query(self, *args, **kw):
           csr = self.cursor(*args, **kw)
           return (Row(csr,r) for rows in iter(csr.fetchmany,[]) for r in rows)
   
   
   class Row(object):
       """Easy-access dict/object wrapper for DBAPI row tuples"""
   
       def __init__(self, cursor, row):
           self.__dict__ = dict(self, zip([d[0]for d in cursor.description], row))
   
   
   
   
   
   
   
   


Generate output suitable for use with a patch program
Legend:
Removed from v.2265  
changed lines
  Added in v.2266

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help