[Subversion] / WebHaiku / web_haiku.py  

Diff of /WebHaiku/web_haiku.py

Parent Directory | Revision Log

version 2276, Tue Jan 23 03:26:51 2007 UTC version 2277, Wed Jan 24 01:45:35 2007 UTC
Line 4 
Line 4 
 from wsgiref.util import shift_path_info, application_uri  from wsgiref.util import shift_path_info, application_uri
   
 __all__ = [  __all__ = [
     "Page", "form_handler", "HTML", "Text", "Template", "HTTP", "test",      "Page", "form_handler", "HTML", "Text", "Template", "HTTP", "expose",
     "EvalTemplate", "EvalMap", "Method",      "test", "Redirector", "EvalTemplate", "EvalMap", "Method",
 ]  ]
   
 class Method(object):  class Method(object):
Line 203 
Line 203 
   
   
   
   def expose(func):
       """Wrapper/decorator that marks a method as a subpage"""
       class _Page(Page):
           def body(self):
               return func(self.parent)
       return _Page
   
   
 class Page(object):  class Page(object):
     """A generic web location"""      """A generic web location"""
   
Line 236 
Line 244 
   
   
   
   
   
   
   
   
   
   
   
     def HEAD(self):      def HEAD(self):
         def write(txt):          def write(txt):
             sr.length += len(txt)              sr.length += len(txt)
Line 633 
Line 633 
 TestContainer.c = TestContainer     # allow some depth to the test...  TestContainer.c = TestContainer     # allow some depth to the test...
   
   
   def Redirector(url):
       """Create a method that will go to a predefined URL (w/embedded vars)"""
       url = Text(url)
       def method(self):
           return self.redirect(url.render(self))
       return method
   
 def additional_tests():  def additional_tests():
     import doctest      import doctest
     return doctest.DocFileSuite(      return doctest.DocFileSuite(
Line 647 
Line 654 
   
   
   
   
   
   
   
   
   
   


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

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help