changeset 82:5ca4be55ad0b trunk

Some minor cleanup.
author cmlenz
date Sat, 15 Jul 2006 11:59:13 +0000
parents d60486018004
children c82309603908
files examples/basic/kidrun.py markup/eval.py markup/template.py
diffstat 3 files changed, 8 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/examples/basic/kidrun.py
+++ b/examples/basic/kidrun.py
@@ -37,9 +37,12 @@
 
 if __name__ == '__main__':
     if '-p' in sys.argv:
-        import profile, pstats
-        profile.run('test()', '.tmpl_prof')
-        stats = pstats.Stats('.tmpl_prof')
-        stats.strip_dirs().sort_stats('time').print_stats(10)
+        import hotshot, hotshot.stats
+        prof = hotshot.Profile("template.prof")
+        benchtime = prof.runcall(test)
+        stats = hotshot.stats.load("template.prof")
+        stats.strip_dirs()
+        stats.sort_stats('time', 'calls')
+        stats.print_stats()
     else:
         test()
--- a/markup/eval.py
+++ b/markup/eval.py
@@ -267,8 +267,3 @@
             # return
             self.nextBlock(return_)
             self.emit('LOAD_NAME', 'val')
-
-
-if __name__ == '__main__':
-    import doctest
-    doctest.testmod()
--- a/markup/template.py
+++ b/markup/template.py
@@ -11,28 +11,7 @@
 # individuals. For the exact contribution history, see the revision
 # history and logs, available at http://markup.edgewall.org/log/.
 
-"""Template engine that is compatible with Kid (http://kid.lesscode.org) to a
-certain extent.
-
-Differences include:
- * No generation of Python code for a template; the template is "interpreted"
- * No support for <?python ?> processing instructions
- * Expressions are evaluated in a more flexible manner, meaning you can use e.g.
-   attribute access notation to access items in a dictionary, etc
- * Use of XInclude and match templates instead of Kid's py:extends/py:layout
-   directives
- * Real (thread-safe) search path support
- * No dependency on ElementTree (due to the lack of pos info)
- * The original pos of parse events is kept throughout the processing
-   pipeline, so that errors can be tracked back to a specific line/column in
-   the template file
- * py:match directives use (basic) XPath expressions to match against input
-   nodes, making match templates more powerful while keeping the syntax simple
-
-Todo items:
- * Improved error reporting
- * Support for list comprehensions and generator expressions in expressions
-"""
+"""Implementation of the template engine."""
 
 try:
     from collections import deque
Copyright (C) 2012-2017 Edgewall Software