[Subversion] / WebHaiku / web_haiku.py  

Diff of /WebHaiku/web_haiku.py

Parent Directory | Revision Log

version 2277, Wed Jan 24 01:45:35 2007 UTC version 2278, Wed Jan 24 03:06:24 2007 UTC
Line 61 
Line 61 
         return True          return True
   
     def __getitem__(self, key):      def __getitem__(self, key):
         if key.startswith('(?'):          if key.startswith('(?') or '.' in key:
             return eval(key[2:].rstrip(')').rstrip('?').strip(),              return eval(key.lstrip('(').rstrip(')').strip('?').strip(),
                         sys.modules[self.module].__dict__, self)                          sys.modules[self.module].__dict__, self)
         elif key in self.extra:          elif key in self.extra:
             return self.extra[key]              return self.extra[key]
Line 78 
Line 78 
         raise KeyError(key)          raise KeyError(key)
   
 class EvalTemplate(string.Template):  class EvalTemplate(string.Template):
     idpattern = r'[_a-z][_a-z0-9]*|\(\?[^?]*\?\)'      idpattern = r'[_a-z][_a-z0-9]*(?:\.[_a-z][_a-z0-9]*)*|\(\?[^?]*\?\)'
   
 class Text(Method):  class Text(Method):
     """Text template w/string substitution that can be used as a method      """Text template w/string substitution that can be used as a method


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

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help