Mercurial > p > roundup > code
comparison roundup/template_parser.py @ 934:fdcf16b444a9
Use a real parser for templates.
Rewrite htmltemplate to use the parser (hack, hack).
Move the "do_XXX" methods to template_funcs.py.
Redo the funcion tests (but not Template tests - they're hopeless).
Simplified query form in cgi_client.
Ability to delete msgs, files, queries.
Ability to edit the metadata on files.
| author | Gordon B. McMillan <gmcm@users.sourceforge.net> |
|---|---|
| date | Tue, 13 Aug 2002 20:16:10 +0000 |
| parents | a43fa69c1b70 |
| children | 540fc5fb20d4 |
comparison
equal
deleted
inserted
replaced
| 933:6bc4e245258f | 934:fdcf16b444a9 |
|---|---|
| 32 class Property: | 32 class Property: |
| 33 ''' Encapsulates a parsed <property attributes> | 33 ''' Encapsulates a parsed <property attributes> |
| 34 ''' | 34 ''' |
| 35 def __init__(self, attributes): | 35 def __init__(self, attributes): |
| 36 self.attributes = attributes | 36 self.attributes = attributes |
| 37 self.current = self.structure = [] | 37 self.current = self.ok = [] |
| 38 def __len__(self): | 38 def __len__(self): |
| 39 return len(self.current) | 39 return len(self.current) |
| 40 def __getitem__(self, n): | 40 def __getitem__(self, n): |
| 41 return self.current[n] | 41 return self.current[n] |
| 42 def __setitem__(self, n, data): | 42 def __setitem__(self, n, data): |
| 132 l.append(display(entry.fail, indent+' ')) | 132 l.append(display(entry.fail, indent+' ')) |
| 133 elif isinstance(entry, Display): | 133 elif isinstance(entry, Display): |
| 134 l.append('%sDISPLAY: %r'%(indent, entry.attributes)) | 134 l.append('%sDISPLAY: %r'%(indent, entry.attributes)) |
| 135 elif isinstance(entry, Property): | 135 elif isinstance(entry, Property): |
| 136 l.append('%sPROPERTY: %r'%(indent, entry.attributes)) | 136 l.append('%sPROPERTY: %r'%(indent, entry.attributes)) |
| 137 l.append(display(entry.structure, indent+' ')) | 137 l.append(display(entry.ok, indent+' ')) |
| 138 return ''.join(l) | 138 return ''.join(l) |
| 139 | 139 |
| 140 if __name__ == '__main__': | 140 if __name__ == '__main__': |
| 141 import sys | 141 import sys |
| 142 parser = RoundupTemplate() | 142 parser = RoundupTemplate() |
