Browse Source

HUE-171. Update HUE to Mako 0.3.4

Removing Mako 0.3.3; adding 0.3.4.
Adding MarkupSafe, which is required by Mako
Philip Zeyliger 15 years ago
parent
commit
8809c4c994
100 changed files with 319 additions and 145 deletions
  1. 20 1
      desktop/core/ext-py/Mako-0.3.4/CHANGES
  2. 0 0
      desktop/core/ext-py/Mako-0.3.4/LICENSE
  3. 1 1
      desktop/core/ext-py/Mako-0.3.4/MANIFEST.in
  4. 1 1
      desktop/core/ext-py/Mako-0.3.4/PKG-INFO
  5. 0 0
      desktop/core/ext-py/Mako-0.3.4/README
  6. 0 0
      desktop/core/ext-py/Mako-0.3.4/README.py3k
  7. 34 26
      desktop/core/ext-py/Mako-0.3.4/distribute_setup.py
  8. 2 2
      desktop/core/ext-py/Mako-0.3.4/doc/caching.html
  9. 7 7
      desktop/core/ext-py/Mako-0.3.4/doc/defs.html
  10. 0 0
      desktop/core/ext-py/Mako-0.3.4/doc/docs.css
  11. 43 41
      desktop/core/ext-py/Mako-0.3.4/doc/documentation.html
  12. 10 10
      desktop/core/ext-py/Mako-0.3.4/doc/filtering.html
  13. 0 0
      desktop/core/ext-py/Mako-0.3.4/doc/highlight.css
  14. 1 1
      desktop/core/ext-py/Mako-0.3.4/doc/index.html
  15. 3 3
      desktop/core/ext-py/Mako-0.3.4/doc/inheritance.html
  16. 0 0
      desktop/core/ext-py/Mako-0.3.4/doc/makotemplates.txt
  17. 10 10
      desktop/core/ext-py/Mako-0.3.4/doc/namespaces.html
  18. 2 2
      desktop/core/ext-py/Mako-0.3.4/doc/runtime.html
  19. 7 7
      desktop/core/ext-py/Mako-0.3.4/doc/syntax.html
  20. 8 6
      desktop/core/ext-py/Mako-0.3.4/doc/unicode.html
  21. 2 2
      desktop/core/ext-py/Mako-0.3.4/doc/usage.html
  22. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/basic.py
  23. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/cheetah/footer.tmpl
  24. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/cheetah/header.tmpl
  25. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/cheetah/template.tmpl
  26. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/django/templatetags/__init__.py
  27. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/django/templatetags/bench.py
  28. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/kid/base.kid
  29. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/kid/template.kid
  30. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/myghty/base.myt
  31. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/bench/myghty/template.myt
  32. 0 0
      desktop/core/ext-py/Mako-0.3.4/examples/wsgi/run_wsgi.py
  33. 1 1
      desktop/core/ext-py/Mako-0.3.4/mako/__init__.py
  34. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/_ast_util.py
  35. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ast.py
  36. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/cache.py
  37. 9 3
      desktop/core/ext-py/Mako-0.3.4/mako/codegen.py
  38. 1 1
      desktop/core/ext-py/Mako-0.3.4/mako/exceptions.py
  39. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ext/__init__.py
  40. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ext/autohandler.py
  41. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ext/babelplugin.py
  42. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ext/preprocessors.py
  43. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ext/pygmentplugin.py
  44. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/ext/turbogears.py
  45. 12 2
      desktop/core/ext-py/Mako-0.3.4/mako/filters.py
  46. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/lexer.py
  47. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/lookup.py
  48. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/parsetree.py
  49. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/pygen.py
  50. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/pyparser.py
  51. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/runtime.py
  52. 4 2
      desktop/core/ext-py/Mako-0.3.4/mako/template.py
  53. 0 0
      desktop/core/ext-py/Mako-0.3.4/mako/util.py
  54. 0 0
      desktop/core/ext-py/Mako-0.3.4/scripts/mako-render
  55. 0 0
      desktop/core/ext-py/Mako-0.3.4/setup.cfg
  56. 1 0
      desktop/core/ext-py/Mako-0.3.4/setup.py
  57. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/__init__.py
  58. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/foo/__init__.py
  59. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/foo/test_ns.py
  60. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/sample_module_namespace.py
  61. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/badbom.html
  62. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/bom.html
  63. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/bommagic.html
  64. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/chs_unicode.html
  65. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/chs_unicode_py3k.html
  66. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/chs_utf8.html
  67. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/crlf.html
  68. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/foo/modtest.html.py
  69. 83 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/gettext.mako
  70. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/index.html
  71. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/internationalization.html
  72. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/modtest.html
  73. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/read_unicode.html
  74. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/read_unicode_py3k.html
  75. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/runtimeerr.html
  76. 4 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/runtimeerr_py3k.html
  77. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/foo/modtest.html.py
  78. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/incl.html
  79. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/index.html
  80. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/modtest.html
  81. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode.html
  82. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_arguments.html
  83. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_arguments_py3k.html
  84. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_code.html
  85. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_code_py3k.html
  86. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_expr.html
  87. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_expr_py3k.html
  88. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_runtime_error.html
  89. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_syntax_error.html
  90. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_ast.py
  91. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_babelplugin.py
  92. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_cache.py
  93. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_call.py
  94. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_decorators.py
  95. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_def.py
  96. 28 15
      desktop/core/ext-py/Mako-0.3.4/test/test_exceptions.py
  97. 25 1
      desktop/core/ext-py/Mako-0.3.4/test/test_filters.py
  98. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_inheritance.py
  99. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_lexer.py
  100. 0 0
      desktop/core/ext-py/Mako-0.3.4/test/test_lookup.py

+ 20 - 1
desktop/core/ext-py/Mako-0.3.3/CHANGES → desktop/core/ext-py/Mako-0.3.4/CHANGES

@@ -1,4 +1,23 @@
-
+0.3.4
+- Now using MarkupSafe for HTML escaping,
+  i.e. in place of cgi.escape().  Faster
+  C-based implementation and also escapes
+  single quotes for additional security.
+  Supports the __html__ attribute for
+  the given expression as well.
+  
+  When using "disable_unicode" mode,
+  a pure Python HTML escaper function
+  is used which also quotes single quotes.
+  
+  Note that Pylons by default doesn't 
+  use Mako's filter - check your 
+  environment.py file.
+  
+- Fixed call to "unicode.strip" in 
+  exceptions.text_error_template which
+  is not Py3k compatible.  [ticket:137]
+  
 0.3.3
 - Added conditional to RichTraceback
   such that if no traceback is passed

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/LICENSE → desktop/core/ext-py/Mako-0.3.4/LICENSE


+ 1 - 1
desktop/core/ext-py/Mako-0.3.3/MANIFEST.in → desktop/core/ext-py/Mako-0.3.4/MANIFEST.in

@@ -3,7 +3,7 @@
 
 recursive-include doc *.html *.css *.txt *.js *.jpg *.png *.py Makefile *.rst *.mako *.sty autohandler
 recursive-include examples *.py *.xml *.mako *.myt *.kid *.tmpl
-recursive-include test *.py *.dat *.html
+recursive-include test *.py *.dat *.html *.mako
 
 include README* LICENSE distribute_setup.py ez_setup.py CHANGES*
 

+ 1 - 1
desktop/core/ext-py/Mako-0.3.3/PKG-INFO → desktop/core/ext-py/Mako-0.3.4/PKG-INFO

@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Mako
-Version: 0.3.3
+Version: 0.3.4
 Summary: A super-fast templating language that borrows the  best ideas from the existing templating languages.
 Home-page: http://www.makotemplates.org/
 Author: Mike Bayer

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/README → desktop/core/ext-py/Mako-0.3.4/README


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/README.py3k → desktop/core/ext-py/Mako-0.3.4/README.py3k


+ 34 - 26
desktop/core/ext-py/Mako-0.3.3/distribute_setup.py → desktop/core/ext-py/Mako-0.3.4/distribute_setup.py

@@ -46,7 +46,7 @@ except ImportError:
             args = [quote(arg) for arg in args]
         return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
 
-DEFAULT_VERSION = "0.6.10"
+DEFAULT_VERSION = "0.6.13"
 DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
 SETUPTOOLS_FAKED_VERSION = "0.6c11"
 
@@ -203,6 +203,29 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
                 dst.close()
     return os.path.realpath(saveto)
 
+def _no_sandbox(function):
+    def __no_sandbox(*args, **kw):
+        try:
+            from setuptools.sandbox import DirectorySandbox
+            if not hasattr(DirectorySandbox, '_old'):
+                def violation(*args):
+                    pass
+                DirectorySandbox._old = DirectorySandbox._violation
+                DirectorySandbox._violation = violation
+                patched = True
+            else:
+                patched = False
+        except ImportError:
+            patched = False
+
+        try:
+            return function(*args, **kw)
+        finally:
+            if patched:
+                DirectorySandbox._violation = DirectorySandbox._old
+                del DirectorySandbox._old
+
+    return __no_sandbox
 
 def _patch_file(path, content):
     """Will backup the file then patch it"""
@@ -220,32 +243,11 @@ def _patch_file(path, content):
         f.close()
     return True
 
+_patch_file = _no_sandbox(_patch_file)
 
 def _same_content(path, content):
     return open(path).read() == content
 
-def _no_sandbox(function):
-    def __no_sandbox(*args, **kw):
-        try:
-            from setuptools.sandbox import DirectorySandbox
-            def violation(*args):
-                pass
-            DirectorySandbox._old = DirectorySandbox._violation
-            DirectorySandbox._violation = violation
-            patched = True
-        except ImportError:
-            patched = False
-
-        try:
-            return function(*args, **kw)
-        finally:
-            if patched:
-                DirectorySandbox._violation = DirectorySandbox._old
-                del DirectorySandbox._old
-
-    return __no_sandbox
-
-@_no_sandbox
 def _rename_path(path):
     new_name = path + '.OLD.%s' % time.time()
     log.warn('Renaming %s into %s', path, new_name)
@@ -285,13 +287,13 @@ def _remove_flat_installation(placeholder):
                      'Setuptools distribution', element)
     return True
 
+_remove_flat_installation = _no_sandbox(_remove_flat_installation)
 
 def _after_install(dist):
     log.warn('After install bootstrap.')
     placeholder = dist.get_command_obj('install').install_purelib
     _create_fake_setuptools_pkg_info(placeholder)
 
-@_no_sandbox
 def _create_fake_setuptools_pkg_info(placeholder):
     if not placeholder or not os.path.exists(placeholder):
         log.warn('Could not find the install location')
@@ -319,6 +321,8 @@ def _create_fake_setuptools_pkg_info(placeholder):
     finally:
         f.close()
 
+_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
+
 def _patch_egg_dir(path):
     # let's check if it's already patched
     pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
@@ -337,6 +341,7 @@ def _patch_egg_dir(path):
         f.close()
     return True
 
+_patch_egg_dir = _no_sandbox(_patch_egg_dir)
 
 def _before_install():
     log.warn('Before install bootstrap.')
@@ -356,8 +361,8 @@ def _under_prefix(location):
                 if len(args) > index:
                     top_dir = args[index+1]
                     return location.startswith(top_dir)
-            elif option == '--user' and USER_SITE is not None:
-                return location.startswith(USER_SITE)
+        if arg == '--user' and USER_SITE is not None:
+            return location.startswith(USER_SITE)
     return True
 
 
@@ -416,6 +421,9 @@ def _fake_setuptools():
 def _relaunch():
     log.warn('Relaunching...')
     # we have to relaunch the process
+    # pip marker to avoid a relaunch bug
+    if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
+        sys.argv[0] = 'setup.py'
     args = [sys.executable] + sys.argv
     sys.exit(subprocess.call(args))
 

+ 2 - 2
desktop/core/ext-py/Mako-0.3.3/doc/caching.html → desktop/core/ext-py/Mako-0.3.4/doc/caching.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -174,7 +174,7 @@ template text
     <div class="code">
         <div class="highlight"><pre><span class="cp">&lt;%</span><span class="nb">page</span> <span class="na">cached=</span><span class="s">&quot;True&quot;</span> <span class="na">cache_key=</span><span class="s">&quot;${self.filename}&quot;</span><span class="cp">/&gt;</span>
 
-<span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+<span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 
 <span class="cp">## rest of template</span>
 </pre></div>

+ 7 - 7
desktop/core/ext-py/Mako-0.3.3/doc/defs.html → desktop/core/ext-py/Mako-0.3.4/doc/defs.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -208,7 +208,7 @@
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">mystuff</span><span class="o">.</span><span class="n">somedef</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">,</span><span class="n">y</span><span class="o">=</span><span class="mf">7</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="n">mystuff</span><span class="o">.</span><span class="n">somedef</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span><span class="n">y</span><span class="o">=</span><span class="mi">7</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -310,11 +310,11 @@
 
     <div class="code">
         <div class="highlight"><pre><span class="cp">&lt;%</span>
-    <span class="n">x</span> <span class="o">=</span> <span class="mf">12</span>
+    <span class="n">x</span> <span class="o">=</span> <span class="mi">12</span>
 <span class="cp">%&gt;</span>
 <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;outer()&quot;</span><span class="cp">&gt;</span>
     <span class="cp">&lt;%</span>
-        <span class="n">y</span> <span class="o">=</span> <span class="mf">15</span>
+        <span class="n">y</span> <span class="o">=</span> <span class="mi">15</span>
     <span class="cp">%&gt;</span>
     <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;inner()&quot;</span><span class="cp">&gt;</span>
         inner, x is <span class="cp">${</span><span class="n">x</span><span class="cp">}</span>, y is <span class="cp">${</span><span class="n">y</span><span class="cp">}</span>
@@ -333,13 +333,13 @@
 
     <div class="code">
         <div class="highlight"><pre><span class="cp">&lt;%</span>
-    <span class="n">x</span> <span class="o">=</span> <span class="mf">10</span>
+    <span class="n">x</span> <span class="o">=</span> <span class="mi">10</span>
 <span class="cp">%&gt;</span>
 <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;somedef()&quot;</span><span class="cp">&gt;</span>
     <span class="cp">## error !</span>
     somedef, x is <span class="cp">${</span><span class="n">x</span><span class="cp">}</span>  
     <span class="cp">&lt;%</span>
-        <span class="n">x</span> <span class="o">=</span> <span class="mf">27</span>  
+        <span class="n">x</span> <span class="o">=</span> <span class="mi">27</span>  
     <span class="cp">%&gt;</span>
 <span class="cp">&lt;/%</span><span class="nb">def</span><span class="cp">&gt;</span>
 </pre></div>
@@ -367,7 +367,7 @@
 
 <p>A flip-side to def within def is a def call with content.  This is where you call a def, and at the same time declare a block of content (or multiple blocks) that can be used by the def being called.  The main point of such a call is to create custom, nestable tags, just like any other template language's custom-tag creation system - where the external tag controls the execution of the nested tags and can communicate state to them.  Only with Mako, you don't have to use any external Python modules, you can define arbitrarily nestable tags right in your templates.
 </p>
-<p>To achieve this, the target def is invoked using the form <code>&lt;%namepacename:defname&gt;</code> instead of the normal <code>${}</code> syntax.  This syntax, introduced in Mako 0.2.3, is functionally equivalent another tag known as <code>call</code>, which takes the form <code>&lt;%call expr='namespacename.defname(args)'&gt;</code>.  While <code>%call</code> is available in all versions of Mako, the newer style is probably more familiar looking.  The <code>namespace</code> portion of the call is the name of the <strong>namespace</strong> in which the def is defined - in the most simple cases, this can be <code>local</code> or <code>self</code> to reference the current template's namespace (the difference between <code>local</code> and <code>self</code> is one of inheritance - see <a href="namespaces.html#namespaces_builtin">Built-in Namespaces</a> for details).
+<p>To achieve this, the target def is invoked using the form <code>&lt;%namepacename:defname&gt;</code> instead of the normal <code>${}</code> syntax.  This syntax, introduced in Mako 0.2.3, is functionally equivalent another tag known as <code>call</code>, which takes the form <code>&lt;%call expr=&#39;namespacename.defname(args)&#39;&gt;</code>.  While <code>%call</code> is available in all versions of Mako, the newer style is probably more familiar looking.  The <code>namespace</code> portion of the call is the name of the <strong>namespace</strong> in which the def is defined - in the most simple cases, this can be <code>local</code> or <code>self</code> to reference the current template's namespace (the difference between <code>local</code> and <code>self</code> is one of inheritance - see <a href="namespaces.html#namespaces_builtin">Built-in Namespaces</a> for details).
 </p>
 <p>When the target def is invoked, a variable <code>caller</code> is placed in its context which contains another namespace containing the body and other defs defined by the caller.  The body itself is referenced by the method <code>body()</code>.  Below, we build a <code>%def</code> that operates upon <code>caller.body()</code> to invoke the body of the custom tag:
 </p>

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/doc/docs.css → desktop/core/ext-py/Mako-0.3.4/doc/docs.css


+ 43 - 41
desktop/core/ext-py/Mako-0.3.3/doc/documentation.html → desktop/core/ext-py/Mako-0.3.4/doc/documentation.html

@@ -30,7 +30,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -689,7 +689,7 @@
 
     <div class="code">
         <div class="highlight"><pre><span class="n">mylookup</span> <span class="o">=</span> <span class="n">TemplateLookup</span><span class="p">(</span><span class="n">directories</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;/docs&#39;</span><span class="p">],</span> 
-                <span class="n">module_directory</span><span class="o">=</span><span class="s">&#39;/tmp/mako_modules&#39;</span><span class="p">,</span> <span class="n">collection_size</span><span class="o">=</span><span class="mf">500</span><span class="p">)</span>
+                <span class="n">module_directory</span><span class="o">=</span><span class="s">&#39;/tmp/mako_modules&#39;</span><span class="p">,</span> <span class="n">collection_size</span><span class="o">=</span><span class="mi">500</span><span class="p">)</span>
 </pre></div>
 
     </div>
@@ -1152,7 +1152,7 @@ msgstr &quot;&quot;
     
 
     <div class="code">
-        <div class="highlight"><pre>pythagorean theorem:  <span class="cp">${</span><span class="nb">pow</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mf">2</span><span class="p">)</span> <span class="o">+</span> <span class="nb">pow</span><span class="p">(</span><span class="n">y</span><span class="p">,</span><span class="mf">2</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre>pythagorean theorem:  <span class="cp">${</span><span class="nb">pow</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="nb">pow</span><span class="p">(</span><span class="n">y</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -1215,7 +1215,7 @@ msgstr &quot;&quot;
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">%</span> <span class="k">if</span> <span class="n">x</span><span class="o">==</span><span class="mf">5</span><span class="p">:</span>
+        <div class="highlight"><pre><span class="cp">%</span> <span class="k">if</span> <span class="n">x</span><span class="o">==</span><span class="mi">5</span><span class="p">:</span>
     this is some output
 <span class="cp">%</span><span class="k"> endif</span>
 </pre></div>
@@ -1229,9 +1229,9 @@ msgstr &quot;&quot;
 
     <div class="code">
         <div class="highlight"><pre><span class="cp">%</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;one&#39;</span><span class="p">,</span> <span class="s">&#39;two&#39;</span><span class="p">,</span> <span class="s">&#39;three&#39;</span><span class="p">,</span> <span class="s">&#39;four&#39;</span><span class="p">,</span> <span class="s">&#39;five&#39;</span><span class="p">]:</span>
-    <span class="cp">%</span> <span class="k">if</span> <span class="n">a</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;t&#39;</span><span class="p">:</span>
+    <span class="cp">%</span> <span class="k">if</span> <span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;t&#39;</span><span class="p">:</span>
      its two or three
-    <span class="cp">%</span> <span class="k">elif</span> <span class="n">a</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;f&#39;</span><span class="p">:</span>
+    <span class="cp">%</span> <span class="k">elif</span> <span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;f&#39;</span><span class="p">:</span>
     four/five
     <span class="cp">%</span> <span class="k">else</span><span class="p">:</span>
     one
@@ -1366,7 +1366,7 @@ another line.
         <div class="highlight"><pre>this is a template
 <span class="cp">&lt;%</span>
     <span class="n">x</span> <span class="o">=</span> <span class="n">db</span><span class="o">.</span><span class="n">get_resource</span><span class="p">(</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
-    <span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="n">z</span><span class="o">.</span><span class="n">element</span> <span class="k">for</span> <span class="n">z</span> <span class="ow">in</span> <span class="n">x</span> <span class="k">if</span> <span class="n">x</span><span class="o">.</span><span class="n">frobnizzle</span><span class="o">==</span><span class="mf">5</span><span class="p">]</span>
+    <span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="n">z</span><span class="o">.</span><span class="n">element</span> <span class="k">for</span> <span class="n">z</span> <span class="ow">in</span> <span class="n">x</span> <span class="k">if</span> <span class="n">x</span><span class="o">.</span><span class="n">frobnizzle</span><span class="o">==</span><span class="mi">5</span><span class="p">]</span>
 <span class="cp">%&gt;</span>
 <span class="cp">%</span> <span class="k">for</span> <span class="n">elem</span> <span class="ow">in</span> <span class="n">y</span><span class="p">:</span>
     element: <span class="cp">${</span><span class="n">elem</span><span class="cp">}</span>
@@ -1569,7 +1569,7 @@ another line.
     this is myfunc, x is <span class="cp">${</span><span class="n">x</span><span class="cp">}</span>
 <span class="cp">&lt;/%</span><span class="nb">def</span><span class="cp">&gt;</span>
 
-<span class="cp">${</span><span class="n">myfunc</span><span class="p">(</span><span class="mf">7</span><span class="p">)</span><span class="cp">}</span>
+<span class="cp">${</span><span class="n">myfunc</span><span class="p">(</span><span class="mi">7</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -1958,7 +1958,7 @@ another line.
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">mystuff</span><span class="o">.</span><span class="n">somedef</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">,</span><span class="n">y</span><span class="o">=</span><span class="mf">7</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="n">mystuff</span><span class="o">.</span><span class="n">somedef</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span><span class="n">y</span><span class="o">=</span><span class="mi">7</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -2060,11 +2060,11 @@ another line.
 
     <div class="code">
         <div class="highlight"><pre><span class="cp">&lt;%</span>
-    <span class="n">x</span> <span class="o">=</span> <span class="mf">12</span>
+    <span class="n">x</span> <span class="o">=</span> <span class="mi">12</span>
 <span class="cp">%&gt;</span>
 <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;outer()&quot;</span><span class="cp">&gt;</span>
     <span class="cp">&lt;%</span>
-        <span class="n">y</span> <span class="o">=</span> <span class="mf">15</span>
+        <span class="n">y</span> <span class="o">=</span> <span class="mi">15</span>
     <span class="cp">%&gt;</span>
     <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;inner()&quot;</span><span class="cp">&gt;</span>
         inner, x is <span class="cp">${</span><span class="n">x</span><span class="cp">}</span>, y is <span class="cp">${</span><span class="n">y</span><span class="cp">}</span>
@@ -2083,13 +2083,13 @@ another line.
 
     <div class="code">
         <div class="highlight"><pre><span class="cp">&lt;%</span>
-    <span class="n">x</span> <span class="o">=</span> <span class="mf">10</span>
+    <span class="n">x</span> <span class="o">=</span> <span class="mi">10</span>
 <span class="cp">%&gt;</span>
 <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;somedef()&quot;</span><span class="cp">&gt;</span>
     <span class="cp">## error !</span>
     somedef, x is <span class="cp">${</span><span class="n">x</span><span class="cp">}</span>  
     <span class="cp">&lt;%</span>
-        <span class="n">x</span> <span class="o">=</span> <span class="mf">27</span>  
+        <span class="n">x</span> <span class="o">=</span> <span class="mi">27</span>  
     <span class="cp">%&gt;</span>
 <span class="cp">&lt;/%</span><span class="nb">def</span><span class="cp">&gt;</span>
 </pre></div>
@@ -2117,7 +2117,7 @@ another line.
 
 <p>A flip-side to def within def is a def call with content.  This is where you call a def, and at the same time declare a block of content (or multiple blocks) that can be used by the def being called.  The main point of such a call is to create custom, nestable tags, just like any other template language's custom-tag creation system - where the external tag controls the execution of the nested tags and can communicate state to them.  Only with Mako, you don't have to use any external Python modules, you can define arbitrarily nestable tags right in your templates.
 </p>
-<p>To achieve this, the target def is invoked using the form <code>&lt;%namepacename:defname&gt;</code> instead of the normal <code>${}</code> syntax.  This syntax, introduced in Mako 0.2.3, is functionally equivalent another tag known as <code>call</code>, which takes the form <code>&lt;%call expr='namespacename.defname(args)'&gt;</code>.  While <code>%call</code> is available in all versions of Mako, the newer style is probably more familiar looking.  The <code>namespace</code> portion of the call is the name of the <strong>namespace</strong> in which the def is defined - in the most simple cases, this can be <code>local</code> or <code>self</code> to reference the current template's namespace (the difference between <code>local</code> and <code>self</code> is one of inheritance - see <a href="#namespaces_builtin">Built-in Namespaces</a> for details).
+<p>To achieve this, the target def is invoked using the form <code>&lt;%namepacename:defname&gt;</code> instead of the normal <code>${}</code> syntax.  This syntax, introduced in Mako 0.2.3, is functionally equivalent another tag known as <code>call</code>, which takes the form <code>&lt;%call expr=&#39;namespacename.defname(args)&#39;&gt;</code>.  While <code>%call</code> is available in all versions of Mako, the newer style is probably more familiar looking.  The <code>namespace</code> portion of the call is the name of the <strong>namespace</strong> in which the def is defined - in the most simple cases, this can be <code>local</code> or <code>self</code> to reference the current template's namespace (the difference between <code>local</code> and <code>self</code> is one of inheritance - see <a href="#namespaces_builtin">Built-in Namespaces</a> for details).
 </p>
 <p>When the target def is invoked, a variable <code>caller</code> is placed in its context which contains another namespace containing the body and other defs defined by the caller.  The body itself is referenced by the method <code>body()</code>.  Below, we build a <code>%def</code> that operates upon <code>caller.body()</code> to invoke the body of the custom tag:
 </p>
@@ -2575,7 +2575,7 @@ Body data: <span class="cp">${</span><span class="n">col</span><span class="cp">
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -2730,7 +2730,7 @@ Body data: <span class="cp">${</span><span class="n">col</span><span class="cp">
 <span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">name=</span><span class="s">&quot;comp&quot;</span> <span class="na">file=</span><span class="s">&quot;components.html&quot;</span><span class="cp">/&gt;</span>
 
 Heres comp1:  <span class="cp">${</span><span class="n">comp</span><span class="o">.</span><span class="n">comp1</span><span class="p">()</span><span class="cp">}</span>
-Heres comp2:  <span class="cp">${</span><span class="n">comp</span><span class="o">.</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">)</span><span class="cp">}</span>
+Heres comp2:  <span class="cp">${</span><span class="n">comp</span><span class="o">.</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -2746,7 +2746,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp</span><span class="
         <div class="highlight"><pre><span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">file=</span><span class="s">&quot;components.html&quot;</span> <span class="na">import=</span><span class="s">&quot;comp1, comp2&quot;</span><span class="cp">/&gt;</span>
 
 Heres comp1:  <span class="cp">${</span><span class="n">comp1</span><span class="p">()</span><span class="cp">}</span>
-Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">)</span><span class="cp">}</span>
+Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -2760,7 +2760,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
         <div class="highlight"><pre><span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">file=</span><span class="s">&quot;components.html&quot;</span> <span class="na">import=</span><span class="s">&quot;*&quot;</span><span class="cp">/&gt;</span>
 
 Heres comp1:  <span class="cp">${</span><span class="n">comp1</span><span class="p">()</span><span class="cp">}</span>
-Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">)</span><span class="cp">}</span>
+Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -2890,7 +2890,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
 </pre></div>
 
     </div>
-<p>Note that the <code>context</code> argument is not needed in the call; the <code>namespace</code> tag creates a locally-scoped callable which takes care of it.   The <code>return ''</code> is so that the def does not dump a <code>None</code> into the output stream - the return value of any def is rendered after the def completes, in addition to whatever was passed to <code>context.write()</code> within its body.
+<p>Note that the <code>context</code> argument is not needed in the call; the <code>namespace</code> tag creates a locally-scoped callable which takes care of it.   The <code>return &#39;&#39;</code> is so that the def does not dump a <code>None</code> into the output stream - the return value of any def is rendered after the def completes, in addition to whatever was passed to <code>context.write()</code> within its body.
 </p>
 <p>If your def is to be called in an "embedded content" context, that is as described in <a href="#defs_defswithcontent">Calling a def with embedded content and/or other defs</a>, you should use the <code>@supports_caller</code> decorator, which will ensure that Mako will ensure the correct "caller" variable is available when your def is called, supporting embedded content:
 </p>
@@ -3001,7 +3001,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="mf">5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mf">10</span><span class="p">,</span> <span class="n">someval</span><span class="o">=</span><span class="mf">15</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="mf">7</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">someval</span><span class="o">=</span><span class="mi">15</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="mi">7</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -3012,7 +3012,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -3146,7 +3146,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     
     
 
-<p>The <code>&lt;%namespace&gt;</code> tag includes an optional attribute <code>inheritable=&quot;True&quot;</code>, which will cause the namespace to be attached to the <code>self</code> namespace.  Since <code>self</code> is globally available throughout an inheritance chain (described in the next section), all the templates in an inheritance chain can get at the namespace imported in a super-template via <code>self</code>.
+<p>The <code>&lt;%namespace&gt;</code> tag includes an optional attribute <code>inheritable=&#34;True&#34;</code>, which will cause the namespace to be attached to the <code>self</code> namespace.  Since <code>self</code> is globally available throughout an inheritance chain (described in the next section), all the templates in an inheritance chain can get at the namespace imported in a super-template via <code>self</code>.
 </p>
 
     
@@ -3156,7 +3156,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
         <div class="highlight"><pre><span class="cp">## base.html</span>
 <span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">name=</span><span class="s">&quot;foo&quot;</span> <span class="na">file=</span><span class="s">&quot;foo.html&quot;</span> <span class="na">inheritable=</span><span class="s">&quot;True&quot;</span><span class="cp">/&gt;</span>
 
-<span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+<span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 
 <span class="cp">## somefile.html</span>
 <span class="cp">&lt;%</span><span class="nb">inherit</span> <span class="na">file=</span><span class="s">&quot;base.html&quot;</span><span class="cp">/&gt;</span>
@@ -3167,7 +3167,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     </div>
 <p>This allows a super-template to load a whole bunch of namespaces that its inheriting templates can get to, without them having to explicitly load those namespaces themselves.
 </p>
-<p>The <code>import=&quot;*&quot;</code> part of the <code>&lt;%namespace&gt;</code> tag doesn't yet interact with the <code>inheritable</code> flag, so currently you have to use the explicit namespace name off of <code>self</code>, followed by the desired function name.  But more on this in a future release.
+<p>The <code>import=&#34;*&#34;</code> part of the <code>&lt;%namespace&gt;</code> tag doesn't yet interact with the <code>inheritable</code> flag, so currently you have to use the explicit namespace name off of <code>self</code>, followed by the desired function name.  But more on this in a future release.
 </p>
 
 
@@ -3355,7 +3355,7 @@ this is the body content.
             <span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">header</span><span class="p">()</span><span class="cp">}</span>
         <span class="nt">&lt;/div&gt;</span>
 
-        <span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+        <span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 
         <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;footer&quot;</span><span class="nt">&gt;</span>
             <span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">footer</span><span class="p">()</span><span class="cp">}</span>
@@ -3382,7 +3382,7 @@ this is the body content.
     <span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="p">()</span><span class="cp">}</span>
 <span class="nt">&lt;/ul&gt;</span>
 <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;mainlayout&quot;</span><span class="nt">&gt;</span>
-    <span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+    <span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 <span class="nt">&lt;/div&gt;</span>
 
 <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;toolbar()&quot;</span><span class="cp">&gt;</span>
@@ -3662,11 +3662,11 @@ This is the body
 </p>
 <ul>
  <li>
-     <code>u</code> : URL escaping, provided by <code>urllib.quote_plus(string.encode('utf-8'))</code>
+     <code>u</code> : URL escaping, provided by <code>urllib.quote_plus(string.encode(&#39;utf-8&#39;))</code>
  </li>
 
  <li>
-     <code>h</code> : HTML escaping, provided by <code>cgi.escape(string, True)</code>
+     <code>h</code> : HTML escaping, provided by <code>markupsafe.escape(string)</code>  (new as of 0.3.4 - prior versions use <code>cgi.escape(string, True)</code>)
  </li>
 
  <li>
@@ -3773,7 +3773,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
     
 
-<p>In addition to the <code>expression_filter</code> argument, the <code>default_filters</code> argument to both <code>Template</code> and <code>TemplateLookup</code> can specify filtering for all expression tags at the programmatic level.  This array-based argument, when given its default argument of <code>None</code>, will be internally set to <code>[&quot;unicode&quot;]</code> (or <code>[&quot;str&quot;]</code> on Python 3), except when <code>disable_unicode=True</code> is set in which case it defaults to <code>[&quot;str&quot;]</code>:
+<p>In addition to the <code>expression_filter</code> argument, the <code>default_filters</code> argument to both <code>Template</code> and <code>TemplateLookup</code> can specify filtering for all expression tags at the programmatic level.  This array-based argument, when given its default argument of <code>None</code>, will be internally set to <code>[&#34;unicode&#34;]</code> (or <code>[&#34;str&#34;]</code> on Python 3), except when <code>disable_unicode=True</code> is set in which case it defaults to <code>[&#34;str&#34;]</code>:
 </p>
 
     
@@ -3943,7 +3943,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
     
 
-<p>One of Mako's central design goals is speed.  To this end, all of the textual content within a template and its various callables is by default piped directly to the single buffer that is stored within the <code>Context</code> object.  While this normally is easy to miss, it has certain side effects.  The main one is that when you call a def using the normal expression syntax, i.e. <code>${somedef()}</code>, it may appear that the return value of the function is the content it produced, which is then delivered to your template just like any other expression substitution, except that  normally, this is not the case; the return value of <code>${somedef()}</code> is simply the empty string <code>''</code>.  By the time you receive this empty string, the output of <code>somedef()</code> has been sent to the underlying buffer.
+<p>One of Mako's central design goals is speed.  To this end, all of the textual content within a template and its various callables is by default piped directly to the single buffer that is stored within the <code>Context</code> object.  While this normally is easy to miss, it has certain side effects.  The main one is that when you call a def using the normal expression syntax, i.e. <code>${somedef()}</code>, it may appear that the return value of the function is the content it produced, which is then delivered to your template just like any other expression substitution, except that  normally, this is not the case; the return value of <code>${somedef()}</code> is simply the empty string <code>&#39;&#39;</code>.  By the time you receive this empty string, the output of <code>somedef()</code> has been sent to the underlying buffer.
 </p>
 <p>You may not want this effect, if for example you are doing something like this:
 </p>
@@ -3956,7 +3956,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 </pre></div>
 
     </div>
-<p>If the <code>somedef()</code> function produced the content "<code>somedef's results</code>", the above template would produce this output:
+<p>If the <code>somedef()</code> function produced the content "<code>somedef&#39;s results</code>", the above template would produce this output:
 </p>
 
     
@@ -4021,7 +4021,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">capture</span><span class="p">(</span><span class="n">somedef</span><span class="p">,</span> <span class="mf">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="n">capture</span><span class="p">(</span><span class="n">somedef</span><span class="p">,</span> <span class="mi">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -4032,7 +4032,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">somedef</span><span class="p">(</span><span class="mf">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="n">somedef</span><span class="p">(</span><span class="mi">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -4081,7 +4081,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 </pre></div>
 
     </div>
-<p>The above template will return, with more whitespace than this, <code>&quot;BAR this is foo BAR&quot;</code>.  The function is the render callable itself (or possibly a wrapper around it), and by default will write to the context.  To capture its output, use the <code>capture</code> callable in the <code>mako.runtime</code> module (available in templates as just  <code>runtime</code>):
+<p>The above template will return, with more whitespace than this, <code>&#34;BAR this is foo BAR&#34;</code>.  The function is the render callable itself (or possibly a wrapper around it), and by default will write to the context.  To capture its output, use the <code>capture</code> callable in the <code>mako.runtime</code> module (available in templates as just  <code>runtime</code>):
 </p>
 
     
@@ -4103,7 +4103,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 </pre></div>
 
     </div>
-<p>The decorator can be used with top-level defs as well as nested defs.  Note that when calling a top-level def from the <code>Template</code> api, i.e. <code>template.get_def('somedef').render()</code>, the decorator has to write the output to the <code>context</code>, i.e. as in the first example.  The return value gets discarded.
+<p>The decorator can be used with top-level defs as well as nested defs.  Note that when calling a top-level def from the <code>Template</code> api, i.e. <code>template.get_def(&#39;somedef&#39;).render()</code>, the decorator has to write the output to the <code>context</code>, i.e. as in the first example.  The return value gets discarded.
 </p>
 
 
@@ -4156,11 +4156,11 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 
 <p>The Python language supports two ways of representing what we know as "strings", i.e. series of characters.   In Python 2, the two types are <code>string</code> and <code>unicode</code>, and in Python 3 they are <code>bytes</code> and <code>string</code>.   A key aspect of the Python 2 <code>string</code> and Python 3 <code>bytes</code> types are that they  contain no information regarding what <strong>encoding</strong> the data is stored in.   For this reason they were commonly referred to as <strong>byte strings</strong> on Python 2, and Python 3 makes this name more explicit.  The origins of this come from Python's background of being developed before the Unicode standard was even available, back when strings were C-style strings and were just that, a series of bytes.  Strings that had only values below 128 just happened to be <strong>ascii</strong> strings and were printable on the console, whereas strings with values above 128 would produce all kinds of graphical characters and bells.
 </p>
-<p>Contrast the "bytestring" types with the "unicode/string" type.   Objects of this type are created whenever you say something like <code>u&quot;hello world&quot;</code> (or in Python 3, just <code>&quot;hello world&quot;</code>).  In this case, Python represents each character in the string internally using multiple bytes per character (something similar to UTF-16).  Whats important is that when using the <code>unicode</code>/<code>string</code> type to store strings, Python knows the data's encoding; its in its own internal format.  Whereas when using the <code>string</code>/<code>bytes</code> type, it does not.
+<p>Contrast the "bytestring" types with the "unicode/string" type.   Objects of this type are created whenever you say something like <code>u&#34;hello world&#34;</code> (or in Python 3, just <code>&#34;hello world&#34;</code>).  In this case, Python represents each character in the string internally using multiple bytes per character (something similar to UTF-16).  Whats important is that when using the <code>unicode</code>/<code>string</code> type to store strings, Python knows the data's encoding; its in its own internal format.  Whereas when using the <code>string</code>/<code>bytes</code> type, it does not.
 </p>
 <p>When Python 2 attempts to treat a byte-string as a string, which means its attempting to compare/parse its characters, to coerce it into another encoding, or to decode it to a unicode object, it has to guess what the encoding is.  In this case, it will pretty much always guess the encoding as <code>ascii</code>...and if the bytestring contains bytes above value 128, you'll get an error.  Python 3 eliminates much of this confusion by just raising an error unconditionally if a bytestring is used in a character-aware context.
 </p>
-<p>There is one operation that Python <em>can</em> do with a non-ascii bytestring, and its a great source of confusion:  it can dump the bytestring straight out to a stream or a file, with nary a care what the encoding is.  To Python, this is pretty much like dumping any other kind of binary data (like an image) to a stream somewhere.  In Python 2, it is common to see programs that embed all kinds of international characters and encodings into plain byte-strings (i.e. using <code>&quot;hello world&quot;</code> style literals) can fly right through their run, sending reams of strings out to whereever they are going, and the programmer, seeing the same output as was expressed in the input, is now under the illusion that his or her program is Unicode-compliant.  In fact, their program has no unicode awareness whatsoever, and similarly has no ability to interact with libraries that <em>are</em> unicode aware.   Python 3 makes this much less likely by defaulting to unicode as the storage format for strings.
+<p>There is one operation that Python <em>can</em> do with a non-ascii bytestring, and its a great source of confusion:  it can dump the bytestring straight out to a stream or a file, with nary a care what the encoding is.  To Python, this is pretty much like dumping any other kind of binary data (like an image) to a stream somewhere.  In Python 2, it is common to see programs that embed all kinds of international characters and encodings into plain byte-strings (i.e. using <code>&#34;hello world&#34;</code> style literals) can fly right through their run, sending reams of strings out to whereever they are going, and the programmer, seeing the same output as was expressed in the input, is now under the illusion that his or her program is Unicode-compliant.  In fact, their program has no unicode awareness whatsoever, and similarly has no ability to interact with libraries that <em>are</em> unicode aware.   Python 3 makes this much less likely by defaulting to unicode as the storage format for strings.
 </p>
 <p>The "pass through encoded data" scheme is what template languages like Cheetah and earlier versions of Myghty do by default.  Mako as of version 0.2 also supports this mode of operation when using Python 2, using the "disable_unicode=True" flag.  However, when using Mako in its default mode of unicode-aware, it requires explicitness when dealing with non-ascii encodings.  Additionally, if you ever need to handle unicode strings and other kinds of encoding conversions more intelligently, the usage of raw bytestrings quickly becomes a nightmare, since you are sending the Python interpreter collections of bytes for which it can make no intelligent decisions with regards to encoding.   In Python 3 Mako only allows usage of native, unicode strings.
 </p>
@@ -4393,7 +4393,7 @@ Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petit voi
 
 <p>Mako does play some games with the style of buffering used internally, to maximize performance.  Since the buffer is by far the most heavily used object in a render operation, its important!
 </p>
-<p>When calling <code>render()</code> on a template that does not specify any output encoding (i.e. its <code>ascii</code>), Python's <code>cStringIO</code> module, which cannot handle encoding of non-ascii <code>unicode</code> objects (even though it can send raw bytestrings through), is used for buffering.  Otherwise, a custom Mako class called <code>FastEncodingBuffer</code> is used, which essentially is a super dumbed-down version of <code>StringIO</code> that gathers all strings into a list and uses <code>u''.join(elements)</code> to produce the final output - its markedly faster than <code>StringIO</code>.
+<p>When calling <code>render()</code> on a template that does not specify any output encoding (i.e. its <code>ascii</code>), Python's <code>cStringIO</code> module, which cannot handle encoding of non-ascii <code>unicode</code> objects (even though it can send raw bytestrings through), is used for buffering.  Otherwise, a custom Mako class called <code>FastEncodingBuffer</code> is used, which essentially is a super dumbed-down version of <code>StringIO</code> that gathers all strings into a list and uses <code>u&#39;&#39;.join(elements)</code> to produce the final output - its markedly faster than <code>StringIO</code>.
 </p>
 
 
@@ -4418,7 +4418,7 @@ Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petit voi
     
     
 
-<p>Some segements of Mako's userbase choose to make no usage of Unicode whatsoever, and instead would prefer the "passthru" approach; all string expressions in their templates return encoded bytestrings, and they would like these strings to pass right through.   The only advantage to this approach is that templates need not use <code>u&quot;&quot;</code> for literal strings; there's an arguable speed improvement as well since raw bytestrings generally perform slightly faster than unicode objects in Python.  For these users, assuming they're sticking with Python 2, they can hit the <code>disable_unicode=True</code> flag as so:
+<p>Some segements of Mako's userbase choose to make no usage of Unicode whatsoever, and instead would prefer the "passthru" approach; all string expressions in their templates return encoded bytestrings, and they would like these strings to pass right through.   The only advantage to this approach is that templates need not use <code>u&#34;&#34;</code> for literal strings; there's an arguable speed improvement as well since raw bytestrings generally perform slightly faster than unicode objects in Python.  For these users, assuming they're sticking with Python 2, they can hit the <code>disable_unicode=True</code> flag as so:
 </p>
 
     
@@ -4459,7 +4459,9 @@ Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petit voi
     </div>
 <p>Where above that the string literal used within <code>context.write</code> is a regular bytestring. 
 </p>
-<p>When <code>disable_unicode=True</code> is turned on, the <code>default_filters</code> argument which normally defaults to <code>[&quot;unicode&quot;]</code> now defaults to <code>[&quot;str&quot;]</code> instead.  Setting default_filters to the empty list <code>[]</code> can remove the overhead of the <code>str</code> call.  Also, in this mode you <strong>cannot</strong> safely call <code>render_unicode()</code> - you'll get unicode/decode errors.
+<p>When <code>disable_unicode=True</code> is turned on, the <code>default_filters</code> argument which normally defaults to <code>[&#34;unicode&#34;]</code> now defaults to <code>[&#34;str&#34;]</code> instead.  Setting default_filters to the empty list <code>[]</code> can remove the overhead of the <code>str</code> call.  Also, in this mode you <strong>cannot</strong> safely call <code>render_unicode()</code> - you'll get unicode/decode errors.
+</p>
+<p>The <code>h</code> filter (html escape) uses a less performant pure Python escape function in non-unicode mode (note that in versions prior to 0.3.4, it used cgi.escape(), which has been replaced with a function that also escapes single quotes).  This because MarkupSafe only supports Python unicode objects for non-ascii strings.
 </p>
 <p><strong>Rules for using disable_unicode=True</strong>
 </p>
@@ -4605,7 +4607,7 @@ template text
     <div class="code">
         <div class="highlight"><pre><span class="cp">&lt;%</span><span class="nb">page</span> <span class="na">cached=</span><span class="s">&quot;True&quot;</span> <span class="na">cache_key=</span><span class="s">&quot;${self.filename}&quot;</span><span class="cp">/&gt;</span>
 
-<span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+<span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 
 <span class="cp">## rest of template</span>
 </pre></div>

+ 10 - 10
desktop/core/ext-py/Mako-0.3.3/doc/filtering.html → desktop/core/ext-py/Mako-0.3.4/doc/filtering.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -147,11 +147,11 @@
 </p>
 <ul>
  <li>
-     <code>u</code> : URL escaping, provided by <code>urllib.quote_plus(string.encode('utf-8'))</code>
+     <code>u</code> : URL escaping, provided by <code>urllib.quote_plus(string.encode(&#39;utf-8&#39;))</code>
  </li>
 
  <li>
-     <code>h</code> : HTML escaping, provided by <code>cgi.escape(string, True)</code>
+     <code>h</code> : HTML escaping, provided by <code>markupsafe.escape(string)</code>  (new as of 0.3.4 - prior versions use <code>cgi.escape(string, True)</code>)
  </li>
 
  <li>
@@ -258,7 +258,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
     
 
-<p>In addition to the <code>expression_filter</code> argument, the <code>default_filters</code> argument to both <code>Template</code> and <code>TemplateLookup</code> can specify filtering for all expression tags at the programmatic level.  This array-based argument, when given its default argument of <code>None</code>, will be internally set to <code>[&quot;unicode&quot;]</code> (or <code>[&quot;str&quot;]</code> on Python 3), except when <code>disable_unicode=True</code> is set in which case it defaults to <code>[&quot;str&quot;]</code>:
+<p>In addition to the <code>expression_filter</code> argument, the <code>default_filters</code> argument to both <code>Template</code> and <code>TemplateLookup</code> can specify filtering for all expression tags at the programmatic level.  This array-based argument, when given its default argument of <code>None</code>, will be internally set to <code>[&#34;unicode&#34;]</code> (or <code>[&#34;str&#34;]</code> on Python 3), except when <code>disable_unicode=True</code> is set in which case it defaults to <code>[&#34;str&#34;]</code>:
 </p>
 
     
@@ -428,7 +428,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
     
 
-<p>One of Mako's central design goals is speed.  To this end, all of the textual content within a template and its various callables is by default piped directly to the single buffer that is stored within the <code>Context</code> object.  While this normally is easy to miss, it has certain side effects.  The main one is that when you call a def using the normal expression syntax, i.e. <code>${somedef()}</code>, it may appear that the return value of the function is the content it produced, which is then delivered to your template just like any other expression substitution, except that  normally, this is not the case; the return value of <code>${somedef()}</code> is simply the empty string <code>''</code>.  By the time you receive this empty string, the output of <code>somedef()</code> has been sent to the underlying buffer.
+<p>One of Mako's central design goals is speed.  To this end, all of the textual content within a template and its various callables is by default piped directly to the single buffer that is stored within the <code>Context</code> object.  While this normally is easy to miss, it has certain side effects.  The main one is that when you call a def using the normal expression syntax, i.e. <code>${somedef()}</code>, it may appear that the return value of the function is the content it produced, which is then delivered to your template just like any other expression substitution, except that  normally, this is not the case; the return value of <code>${somedef()}</code> is simply the empty string <code>&#39;&#39;</code>.  By the time you receive this empty string, the output of <code>somedef()</code> has been sent to the underlying buffer.
 </p>
 <p>You may not want this effect, if for example you are doing something like this:
 </p>
@@ -441,7 +441,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 </pre></div>
 
     </div>
-<p>If the <code>somedef()</code> function produced the content "<code>somedef's results</code>", the above template would produce this output:
+<p>If the <code>somedef()</code> function produced the content "<code>somedef&#39;s results</code>", the above template would produce this output:
 </p>
 
     
@@ -506,7 +506,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">capture</span><span class="p">(</span><span class="n">somedef</span><span class="p">,</span> <span class="mf">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="n">capture</span><span class="p">(</span><span class="n">somedef</span><span class="p">,</span> <span class="mi">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -517,7 +517,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">somedef</span><span class="p">(</span><span class="mf">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="n">somedef</span><span class="p">(</span><span class="mi">17</span><span class="p">,</span> <span class="s">&#39;hi&#39;</span><span class="p">,</span> <span class="n">use_paging</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -566,7 +566,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 </pre></div>
 
     </div>
-<p>The above template will return, with more whitespace than this, <code>&quot;BAR this is foo BAR&quot;</code>.  The function is the render callable itself (or possibly a wrapper around it), and by default will write to the context.  To capture its output, use the <code>capture</code> callable in the <code>mako.runtime</code> module (available in templates as just  <code>runtime</code>):
+<p>The above template will return, with more whitespace than this, <code>&#34;BAR this is foo BAR&#34;</code>.  The function is the render callable itself (or possibly a wrapper around it), and by default will write to the context.  To capture its output, use the <code>capture</code> callable in the <code>mako.runtime</code> module (available in templates as just  <code>runtime</code>):
 </p>
 
     
@@ -588,7 +588,7 @@ Escaped text:  <span class="cp">${</span><span class="s">&quot;&lt;html&gt;some
 </pre></div>
 
     </div>
-<p>The decorator can be used with top-level defs as well as nested defs.  Note that when calling a top-level def from the <code>Template</code> api, i.e. <code>template.get_def('somedef').render()</code>, the decorator has to write the output to the <code>context</code>, i.e. as in the first example.  The return value gets discarded.
+<p>The decorator can be used with top-level defs as well as nested defs.  Note that when calling a top-level def from the <code>Template</code> api, i.e. <code>template.get_def(&#39;somedef&#39;).render()</code>, the decorator has to write the output to the <code>context</code>, i.e. as in the first example.  The return value gets discarded.
 </p>
 
 

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/doc/highlight.css → desktop/core/ext-py/Mako-0.3.4/doc/highlight.css


+ 1 - 1
desktop/core/ext-py/Mako-0.3.3/doc/index.html → desktop/core/ext-py/Mako-0.3.4/doc/index.html

@@ -30,7 +30,7 @@ Documentation
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 

+ 3 - 3
desktop/core/ext-py/Mako-0.3.3/doc/inheritance.html → desktop/core/ext-py/Mako-0.3.4/doc/inheritance.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -237,7 +237,7 @@ this is the body content.
             <span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">header</span><span class="p">()</span><span class="cp">}</span>
         <span class="nt">&lt;/div&gt;</span>
 
-        <span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+        <span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 
         <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;footer&quot;</span><span class="nt">&gt;</span>
             <span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">footer</span><span class="p">()</span><span class="cp">}</span>
@@ -264,7 +264,7 @@ this is the body content.
     <span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="p">()</span><span class="cp">}</span>
 <span class="nt">&lt;/ul&gt;</span>
 <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;mainlayout&quot;</span><span class="nt">&gt;</span>
-    <span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+    <span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 <span class="nt">&lt;/div&gt;</span>
 
 <span class="cp">&lt;%</span><span class="nb">def</span> <span class="na">name=</span><span class="s">&quot;toolbar()&quot;</span><span class="cp">&gt;</span>

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/doc/makotemplates.txt → desktop/core/ext-py/Mako-0.3.4/doc/makotemplates.txt


+ 10 - 10
desktop/core/ext-py/Mako-0.3.3/doc/namespaces.html → desktop/core/ext-py/Mako-0.3.4/doc/namespaces.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -167,7 +167,7 @@
 <span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">name=</span><span class="s">&quot;comp&quot;</span> <span class="na">file=</span><span class="s">&quot;components.html&quot;</span><span class="cp">/&gt;</span>
 
 Heres comp1:  <span class="cp">${</span><span class="n">comp</span><span class="o">.</span><span class="n">comp1</span><span class="p">()</span><span class="cp">}</span>
-Heres comp2:  <span class="cp">${</span><span class="n">comp</span><span class="o">.</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">)</span><span class="cp">}</span>
+Heres comp2:  <span class="cp">${</span><span class="n">comp</span><span class="o">.</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -183,7 +183,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp</span><span class="
         <div class="highlight"><pre><span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">file=</span><span class="s">&quot;components.html&quot;</span> <span class="na">import=</span><span class="s">&quot;comp1, comp2&quot;</span><span class="cp">/&gt;</span>
 
 Heres comp1:  <span class="cp">${</span><span class="n">comp1</span><span class="p">()</span><span class="cp">}</span>
-Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">)</span><span class="cp">}</span>
+Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -197,7 +197,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
         <div class="highlight"><pre><span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">file=</span><span class="s">&quot;components.html&quot;</span> <span class="na">import=</span><span class="s">&quot;*&quot;</span><span class="cp">/&gt;</span>
 
 Heres comp1:  <span class="cp">${</span><span class="n">comp1</span><span class="p">()</span><span class="cp">}</span>
-Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mf">5</span><span class="p">)</span><span class="cp">}</span>
+Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -327,7 +327,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
 </pre></div>
 
     </div>
-<p>Note that the <code>context</code> argument is not needed in the call; the <code>namespace</code> tag creates a locally-scoped callable which takes care of it.   The <code>return ''</code> is so that the def does not dump a <code>None</code> into the output stream - the return value of any def is rendered after the def completes, in addition to whatever was passed to <code>context.write()</code> within its body.
+<p>Note that the <code>context</code> argument is not needed in the call; the <code>namespace</code> tag creates a locally-scoped callable which takes care of it.   The <code>return &#39;&#39;</code> is so that the def does not dump a <code>None</code> into the output stream - the return value of any def is rendered after the def completes, in addition to whatever was passed to <code>context.write()</code> within its body.
 </p>
 <p>If your def is to be called in an "embedded content" context, that is as described in <a href="defs.html#defs_defswithcontent">Calling a def with embedded content and/or other defs</a>, you should use the <code>@supports_caller</code> decorator, which will ensure that Mako will ensure the correct "caller" variable is available when your def is called, supporting embedded content:
 </p>
@@ -438,7 +438,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="mf">5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mf">10</span><span class="p">,</span> <span class="n">someval</span><span class="o">=</span><span class="mf">15</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="mf">7</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="bp">self</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">someval</span><span class="o">=</span><span class="mi">15</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="mi">7</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -449,7 +449,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -583,7 +583,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     
     
 
-<p>The <code>&lt;%namespace&gt;</code> tag includes an optional attribute <code>inheritable=&quot;True&quot;</code>, which will cause the namespace to be attached to the <code>self</code> namespace.  Since <code>self</code> is globally available throughout an inheritance chain (described in the next section), all the templates in an inheritance chain can get at the namespace imported in a super-template via <code>self</code>.
+<p>The <code>&lt;%namespace&gt;</code> tag includes an optional attribute <code>inheritable=&#34;True&#34;</code>, which will cause the namespace to be attached to the <code>self</code> namespace.  Since <code>self</code> is globally available throughout an inheritance chain (described in the next section), all the templates in an inheritance chain can get at the namespace imported in a super-template via <code>self</code>.
 </p>
 
     
@@ -593,7 +593,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
         <div class="highlight"><pre><span class="cp">## base.html</span>
 <span class="cp">&lt;%</span><span class="nb">namespace</span> <span class="na">name=</span><span class="s">&quot;foo&quot;</span> <span class="na">file=</span><span class="s">&quot;foo.html&quot;</span> <span class="na">inheritable=</span><span class="s">&quot;True&quot;</span><span class="cp">/&gt;</span>
 
-<span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
+<span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">()</span><span class="cp">}</span>
 
 <span class="cp">## somefile.html</span>
 <span class="cp">&lt;%</span><span class="nb">inherit</span> <span class="na">file=</span><span class="s">&quot;base.html&quot;</span><span class="cp">/&gt;</span>
@@ -604,7 +604,7 @@ Heres comp2:  <span class="cp">${</span><span class="n">comp2</span><span class=
     </div>
 <p>This allows a super-template to load a whole bunch of namespaces that its inheriting templates can get to, without them having to explicitly load those namespaces themselves.
 </p>
-<p>The <code>import=&quot;*&quot;</code> part of the <code>&lt;%namespace&gt;</code> tag doesn't yet interact with the <code>inheritable</code> flag, so currently you have to use the explicit namespace name off of <code>self</code>, followed by the desired function name.  But more on this in a future release.
+<p>The <code>import=&#34;*&#34;</code> part of the <code>&lt;%namespace&gt;</code> tag doesn't yet interact with the <code>inheritable</code> flag, so currently you have to use the explicit namespace name off of <code>self</code>, followed by the desired function name.  But more on this in a future release.
 </p>
 
 

+ 2 - 2
desktop/core/ext-py/Mako-0.3.3/doc/runtime.html → desktop/core/ext-py/Mako-0.3.4/doc/runtime.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -279,7 +279,7 @@
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">${</span><span class="n">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre><span class="cp">${</span><span class="nb">next</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="o">**</span><span class="n">context</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>

+ 7 - 7
desktop/core/ext-py/Mako-0.3.3/doc/syntax.html → desktop/core/ext-py/Mako-0.3.4/doc/syntax.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -224,7 +224,7 @@
     
 
     <div class="code">
-        <div class="highlight"><pre>pythagorean theorem:  <span class="cp">${</span><span class="nb">pow</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mf">2</span><span class="p">)</span> <span class="o">+</span> <span class="nb">pow</span><span class="p">(</span><span class="n">y</span><span class="p">,</span><span class="mf">2</span><span class="p">)</span><span class="cp">}</span>
+        <div class="highlight"><pre>pythagorean theorem:  <span class="cp">${</span><span class="nb">pow</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="nb">pow</span><span class="p">(</span><span class="n">y</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>
@@ -287,7 +287,7 @@
     
 
     <div class="code">
-        <div class="highlight"><pre><span class="cp">%</span> <span class="k">if</span> <span class="n">x</span><span class="o">==</span><span class="mf">5</span><span class="p">:</span>
+        <div class="highlight"><pre><span class="cp">%</span> <span class="k">if</span> <span class="n">x</span><span class="o">==</span><span class="mi">5</span><span class="p">:</span>
     this is some output
 <span class="cp">%</span><span class="k"> endif</span>
 </pre></div>
@@ -301,9 +301,9 @@
 
     <div class="code">
         <div class="highlight"><pre><span class="cp">%</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;one&#39;</span><span class="p">,</span> <span class="s">&#39;two&#39;</span><span class="p">,</span> <span class="s">&#39;three&#39;</span><span class="p">,</span> <span class="s">&#39;four&#39;</span><span class="p">,</span> <span class="s">&#39;five&#39;</span><span class="p">]:</span>
-    <span class="cp">%</span> <span class="k">if</span> <span class="n">a</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;t&#39;</span><span class="p">:</span>
+    <span class="cp">%</span> <span class="k">if</span> <span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;t&#39;</span><span class="p">:</span>
      its two or three
-    <span class="cp">%</span> <span class="k">elif</span> <span class="n">a</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;f&#39;</span><span class="p">:</span>
+    <span class="cp">%</span> <span class="k">elif</span> <span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;f&#39;</span><span class="p">:</span>
     four/five
     <span class="cp">%</span> <span class="k">else</span><span class="p">:</span>
     one
@@ -438,7 +438,7 @@ another line.
         <div class="highlight"><pre>this is a template
 <span class="cp">&lt;%</span>
     <span class="n">x</span> <span class="o">=</span> <span class="n">db</span><span class="o">.</span><span class="n">get_resource</span><span class="p">(</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
-    <span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="n">z</span><span class="o">.</span><span class="n">element</span> <span class="k">for</span> <span class="n">z</span> <span class="ow">in</span> <span class="n">x</span> <span class="k">if</span> <span class="n">x</span><span class="o">.</span><span class="n">frobnizzle</span><span class="o">==</span><span class="mf">5</span><span class="p">]</span>
+    <span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="n">z</span><span class="o">.</span><span class="n">element</span> <span class="k">for</span> <span class="n">z</span> <span class="ow">in</span> <span class="n">x</span> <span class="k">if</span> <span class="n">x</span><span class="o">.</span><span class="n">frobnizzle</span><span class="o">==</span><span class="mi">5</span><span class="p">]</span>
 <span class="cp">%&gt;</span>
 <span class="cp">%</span> <span class="k">for</span> <span class="n">elem</span> <span class="ow">in</span> <span class="n">y</span><span class="p">:</span>
     element: <span class="cp">${</span><span class="n">elem</span><span class="cp">}</span>
@@ -641,7 +641,7 @@ another line.
     this is myfunc, x is <span class="cp">${</span><span class="n">x</span><span class="cp">}</span>
 <span class="cp">&lt;/%</span><span class="nb">def</span><span class="cp">&gt;</span>
 
-<span class="cp">${</span><span class="n">myfunc</span><span class="p">(</span><span class="mf">7</span><span class="p">)</span><span class="cp">}</span>
+<span class="cp">${</span><span class="n">myfunc</span><span class="p">(</span><span class="mi">7</span><span class="p">)</span><span class="cp">}</span>
 </pre></div>
 
     </div>

+ 8 - 6
desktop/core/ext-py/Mako-0.3.3/doc/unicode.html → desktop/core/ext-py/Mako-0.3.4/doc/unicode.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -114,11 +114,11 @@
 
 <p>The Python language supports two ways of representing what we know as "strings", i.e. series of characters.   In Python 2, the two types are <code>string</code> and <code>unicode</code>, and in Python 3 they are <code>bytes</code> and <code>string</code>.   A key aspect of the Python 2 <code>string</code> and Python 3 <code>bytes</code> types are that they  contain no information regarding what <strong>encoding</strong> the data is stored in.   For this reason they were commonly referred to as <strong>byte strings</strong> on Python 2, and Python 3 makes this name more explicit.  The origins of this come from Python's background of being developed before the Unicode standard was even available, back when strings were C-style strings and were just that, a series of bytes.  Strings that had only values below 128 just happened to be <strong>ascii</strong> strings and were printable on the console, whereas strings with values above 128 would produce all kinds of graphical characters and bells.
 </p>
-<p>Contrast the "bytestring" types with the "unicode/string" type.   Objects of this type are created whenever you say something like <code>u&quot;hello world&quot;</code> (or in Python 3, just <code>&quot;hello world&quot;</code>).  In this case, Python represents each character in the string internally using multiple bytes per character (something similar to UTF-16).  Whats important is that when using the <code>unicode</code>/<code>string</code> type to store strings, Python knows the data's encoding; its in its own internal format.  Whereas when using the <code>string</code>/<code>bytes</code> type, it does not.
+<p>Contrast the "bytestring" types with the "unicode/string" type.   Objects of this type are created whenever you say something like <code>u&#34;hello world&#34;</code> (or in Python 3, just <code>&#34;hello world&#34;</code>).  In this case, Python represents each character in the string internally using multiple bytes per character (something similar to UTF-16).  Whats important is that when using the <code>unicode</code>/<code>string</code> type to store strings, Python knows the data's encoding; its in its own internal format.  Whereas when using the <code>string</code>/<code>bytes</code> type, it does not.
 </p>
 <p>When Python 2 attempts to treat a byte-string as a string, which means its attempting to compare/parse its characters, to coerce it into another encoding, or to decode it to a unicode object, it has to guess what the encoding is.  In this case, it will pretty much always guess the encoding as <code>ascii</code>...and if the bytestring contains bytes above value 128, you'll get an error.  Python 3 eliminates much of this confusion by just raising an error unconditionally if a bytestring is used in a character-aware context.
 </p>
-<p>There is one operation that Python <em>can</em> do with a non-ascii bytestring, and its a great source of confusion:  it can dump the bytestring straight out to a stream or a file, with nary a care what the encoding is.  To Python, this is pretty much like dumping any other kind of binary data (like an image) to a stream somewhere.  In Python 2, it is common to see programs that embed all kinds of international characters and encodings into plain byte-strings (i.e. using <code>&quot;hello world&quot;</code> style literals) can fly right through their run, sending reams of strings out to whereever they are going, and the programmer, seeing the same output as was expressed in the input, is now under the illusion that his or her program is Unicode-compliant.  In fact, their program has no unicode awareness whatsoever, and similarly has no ability to interact with libraries that <em>are</em> unicode aware.   Python 3 makes this much less likely by defaulting to unicode as the storage format for strings.
+<p>There is one operation that Python <em>can</em> do with a non-ascii bytestring, and its a great source of confusion:  it can dump the bytestring straight out to a stream or a file, with nary a care what the encoding is.  To Python, this is pretty much like dumping any other kind of binary data (like an image) to a stream somewhere.  In Python 2, it is common to see programs that embed all kinds of international characters and encodings into plain byte-strings (i.e. using <code>&#34;hello world&#34;</code> style literals) can fly right through their run, sending reams of strings out to whereever they are going, and the programmer, seeing the same output as was expressed in the input, is now under the illusion that his or her program is Unicode-compliant.  In fact, their program has no unicode awareness whatsoever, and similarly has no ability to interact with libraries that <em>are</em> unicode aware.   Python 3 makes this much less likely by defaulting to unicode as the storage format for strings.
 </p>
 <p>The "pass through encoded data" scheme is what template languages like Cheetah and earlier versions of Myghty do by default.  Mako as of version 0.2 also supports this mode of operation when using Python 2, using the "disable_unicode=True" flag.  However, when using Mako in its default mode of unicode-aware, it requires explicitness when dealing with non-ascii encodings.  Additionally, if you ever need to handle unicode strings and other kinds of encoding conversions more intelligently, the usage of raw bytestrings quickly becomes a nightmare, since you are sending the Python interpreter collections of bytes for which it can make no intelligent decisions with regards to encoding.   In Python 3 Mako only allows usage of native, unicode strings.
 </p>
@@ -351,7 +351,7 @@ Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petit voi
 
 <p>Mako does play some games with the style of buffering used internally, to maximize performance.  Since the buffer is by far the most heavily used object in a render operation, its important!
 </p>
-<p>When calling <code>render()</code> on a template that does not specify any output encoding (i.e. its <code>ascii</code>), Python's <code>cStringIO</code> module, which cannot handle encoding of non-ascii <code>unicode</code> objects (even though it can send raw bytestrings through), is used for buffering.  Otherwise, a custom Mako class called <code>FastEncodingBuffer</code> is used, which essentially is a super dumbed-down version of <code>StringIO</code> that gathers all strings into a list and uses <code>u''.join(elements)</code> to produce the final output - its markedly faster than <code>StringIO</code>.
+<p>When calling <code>render()</code> on a template that does not specify any output encoding (i.e. its <code>ascii</code>), Python's <code>cStringIO</code> module, which cannot handle encoding of non-ascii <code>unicode</code> objects (even though it can send raw bytestrings through), is used for buffering.  Otherwise, a custom Mako class called <code>FastEncodingBuffer</code> is used, which essentially is a super dumbed-down version of <code>StringIO</code> that gathers all strings into a list and uses <code>u&#39;&#39;.join(elements)</code> to produce the final output - its markedly faster than <code>StringIO</code>.
 </p>
 
 
@@ -376,7 +376,7 @@ Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petit voi
     
     
 
-<p>Some segements of Mako's userbase choose to make no usage of Unicode whatsoever, and instead would prefer the "passthru" approach; all string expressions in their templates return encoded bytestrings, and they would like these strings to pass right through.   The only advantage to this approach is that templates need not use <code>u&quot;&quot;</code> for literal strings; there's an arguable speed improvement as well since raw bytestrings generally perform slightly faster than unicode objects in Python.  For these users, assuming they're sticking with Python 2, they can hit the <code>disable_unicode=True</code> flag as so:
+<p>Some segements of Mako's userbase choose to make no usage of Unicode whatsoever, and instead would prefer the "passthru" approach; all string expressions in their templates return encoded bytestrings, and they would like these strings to pass right through.   The only advantage to this approach is that templates need not use <code>u&#34;&#34;</code> for literal strings; there's an arguable speed improvement as well since raw bytestrings generally perform slightly faster than unicode objects in Python.  For these users, assuming they're sticking with Python 2, they can hit the <code>disable_unicode=True</code> flag as so:
 </p>
 
     
@@ -417,7 +417,9 @@ Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petit voi
     </div>
 <p>Where above that the string literal used within <code>context.write</code> is a regular bytestring. 
 </p>
-<p>When <code>disable_unicode=True</code> is turned on, the <code>default_filters</code> argument which normally defaults to <code>[&quot;unicode&quot;]</code> now defaults to <code>[&quot;str&quot;]</code> instead.  Setting default_filters to the empty list <code>[]</code> can remove the overhead of the <code>str</code> call.  Also, in this mode you <strong>cannot</strong> safely call <code>render_unicode()</code> - you'll get unicode/decode errors.
+<p>When <code>disable_unicode=True</code> is turned on, the <code>default_filters</code> argument which normally defaults to <code>[&#34;unicode&#34;]</code> now defaults to <code>[&#34;str&#34;]</code> instead.  Setting default_filters to the empty list <code>[]</code> can remove the overhead of the <code>str</code> call.  Also, in this mode you <strong>cannot</strong> safely call <code>render_unicode()</code> - you'll get unicode/decode errors.
+</p>
+<p>The <code>h</code> filter (html escape) uses a less performant pure Python escape function in non-unicode mode (note that in versions prior to 0.3.4, it used cgi.escape(), which has been replaced with a function that also escapes single quotes).  This because MarkupSafe only supports Python unicode objects for non-ascii strings.
 </p>
 <p><strong>Rules for using disable_unicode=True</strong>
 </p>

+ 2 - 2
desktop/core/ext-py/Mako-0.3.3/doc/usage.html → desktop/core/ext-py/Mako-0.3.4/doc/usage.html

@@ -28,7 +28,7 @@
 
 <h1>Mako Documentation</h1>
 
-<div class="versionheader">Version: 0.3.3   Last Updated: 05/31/10 16:21:29</div>
+<div class="versionheader">Version: 0.3.4   Last Updated: 06/22/10 17:39:23</div>
 
 
 
@@ -317,7 +317,7 @@
 
     <div class="code">
         <div class="highlight"><pre><span class="n">mylookup</span> <span class="o">=</span> <span class="n">TemplateLookup</span><span class="p">(</span><span class="n">directories</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;/docs&#39;</span><span class="p">],</span> 
-                <span class="n">module_directory</span><span class="o">=</span><span class="s">&#39;/tmp/mako_modules&#39;</span><span class="p">,</span> <span class="n">collection_size</span><span class="o">=</span><span class="mf">500</span><span class="p">)</span>
+                <span class="n">module_directory</span><span class="o">=</span><span class="s">&#39;/tmp/mako_modules&#39;</span><span class="p">,</span> <span class="n">collection_size</span><span class="o">=</span><span class="mi">500</span><span class="p">)</span>
 </pre></div>
 
     </div>

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/basic.py → desktop/core/ext-py/Mako-0.3.4/examples/bench/basic.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/cheetah/footer.tmpl → desktop/core/ext-py/Mako-0.3.4/examples/bench/cheetah/footer.tmpl


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/cheetah/header.tmpl → desktop/core/ext-py/Mako-0.3.4/examples/bench/cheetah/header.tmpl


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/cheetah/template.tmpl → desktop/core/ext-py/Mako-0.3.4/examples/bench/cheetah/template.tmpl


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/django/templatetags/__init__.py → desktop/core/ext-py/Mako-0.3.4/examples/bench/django/templatetags/__init__.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/django/templatetags/bench.py → desktop/core/ext-py/Mako-0.3.4/examples/bench/django/templatetags/bench.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/kid/base.kid → desktop/core/ext-py/Mako-0.3.4/examples/bench/kid/base.kid


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/kid/template.kid → desktop/core/ext-py/Mako-0.3.4/examples/bench/kid/template.kid


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/myghty/base.myt → desktop/core/ext-py/Mako-0.3.4/examples/bench/myghty/base.myt


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/bench/myghty/template.myt → desktop/core/ext-py/Mako-0.3.4/examples/bench/myghty/template.myt


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/examples/wsgi/run_wsgi.py → desktop/core/ext-py/Mako-0.3.4/examples/wsgi/run_wsgi.py


+ 1 - 1
desktop/core/ext-py/Mako-0.3.3/mako/__init__.py → desktop/core/ext-py/Mako-0.3.4/mako/__init__.py

@@ -5,5 +5,5 @@
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
 
-__version__ = '0.3.3'
+__version__ = '0.3.4'
 

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/_ast_util.py → desktop/core/ext-py/Mako-0.3.4/mako/_ast_util.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ast.py → desktop/core/ext-py/Mako-0.3.4/mako/ast.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/cache.py → desktop/core/ext-py/Mako-0.3.4/mako/cache.py


+ 9 - 3
desktop/core/ext-py/Mako-0.3.3/mako/codegen.py → desktop/core/ext-py/Mako-0.3.4/mako/codegen.py

@@ -20,7 +20,8 @@ def compile(node,
                 buffer_filters=None, 
                 imports=None, 
                 source_encoding=None, 
-                generate_magic_comment=True):
+                generate_magic_comment=True,
+                disable_unicode=False):
                 
     """Generate module source code given a parsetree node, 
       uri, and optional source filename"""
@@ -43,7 +44,8 @@ def compile(node,
                                             buffer_filters,
                                             imports, 
                                             source_encoding,
-                                            generate_magic_comment), 
+                                            generate_magic_comment,
+                                            disable_unicode), 
                                 node)
     return buf.getvalue()
 
@@ -55,7 +57,8 @@ class _CompileContext(object):
                     buffer_filters, 
                     imports, 
                     source_encoding, 
-                    generate_magic_comment):
+                    generate_magic_comment,
+                    disable_unicode):
         self.uri = uri
         self.filename = filename
         self.default_filters = default_filters
@@ -63,6 +66,7 @@ class _CompileContext(object):
         self.imports = imports
         self.source_encoding = source_encoding
         self.generate_magic_comment = generate_magic_comment
+        self.disable_unicode = disable_unicode
         
 class _GenerateRenderMethod(object):
     """A template visitor object which generates the 
@@ -586,6 +590,8 @@ class _GenerateRenderMethod(object):
         def locate_encode(name):
             if re.match(r'decode\..+', name):
                 return "filters." + name
+            elif self.compiler.disable_unicode:
+                return filters.NON_UNICODE_ESCAPES.get(name, name)
             else:
                 return filters.DEFAULT_ESCAPES.get(name, name)
         

+ 1 - 1
desktop/core/ext-py/Mako-0.3.3/mako/exceptions.py → desktop/core/ext-py/Mako-0.3.4/mako/exceptions.py

@@ -247,7 +247,7 @@ def text_error_template(lookup=None):
 Traceback (most recent call last):
 % for (filename, lineno, function, line) in tback.traceback:
   File "${filename}", line ${lineno}, in ${function or '?'}
-    ${line | unicode.strip}
+    ${line | trim}
 % endfor
 ${tback.errorname}: ${tback.message}
 """)

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ext/__init__.py → desktop/core/ext-py/Mako-0.3.4/mako/ext/__init__.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ext/autohandler.py → desktop/core/ext-py/Mako-0.3.4/mako/ext/autohandler.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ext/babelplugin.py → desktop/core/ext-py/Mako-0.3.4/mako/ext/babelplugin.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ext/preprocessors.py → desktop/core/ext-py/Mako-0.3.4/mako/ext/preprocessors.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ext/pygmentplugin.py → desktop/core/ext-py/Mako-0.3.4/mako/ext/pygmentplugin.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/ext/turbogears.py → desktop/core/ext-py/Mako-0.3.4/mako/ext/turbogears.py


+ 12 - 2
desktop/core/ext-py/Mako-0.3.3/mako/filters.py → desktop/core/ext-py/Mako-0.3.4/mako/filters.py

@@ -5,9 +5,10 @@
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
 
-import re, cgi, urllib, htmlentitydefs, codecs
+import re, urllib, htmlentitydefs, codecs
 from StringIO import StringIO
 from mako import util
+import markupsafe
 
 xml_escapes = {
     '&' : '&amp;',
@@ -16,12 +17,18 @@ xml_escapes = {
     '"' : '&#34;',   # also &quot; in html-only
     "'" : '&#39;'    # also &apos; in html-only    
 }
+
 # XXX: &quot; is valid in HTML and XML
 #      &apos; is not valid HTML, but is valid XML
 
 def html_escape(string):
-    return cgi.escape(string, True)
+    return markupsafe.escape(string)
+
+def legacy_html_escape(string):
+    """legacy HTML escape for non-unicode mode."""
 
+    return re.sub(r'([&<"\'>])', lambda m: xml_escapes[m.group()], string)
+    
 def xml_escape(string):
     return re.sub(r'([&<"\'>])', lambda m: xml_escapes[m.group()], string)
 
@@ -173,3 +180,6 @@ if util.py3k:
         'unicode':'str'
     })
 
+NON_UNICODE_ESCAPES = DEFAULT_ESCAPES.copy()
+NON_UNICODE_ESCAPES['h'] = 'filters.legacy_html_escape'
+

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/lexer.py → desktop/core/ext-py/Mako-0.3.4/mako/lexer.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/lookup.py → desktop/core/ext-py/Mako-0.3.4/mako/lookup.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/parsetree.py → desktop/core/ext-py/Mako-0.3.4/mako/parsetree.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/pygen.py → desktop/core/ext-py/Mako-0.3.4/mako/pygen.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/pyparser.py → desktop/core/ext-py/Mako-0.3.4/mako/pyparser.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/runtime.py → desktop/core/ext-py/Mako-0.3.4/mako/runtime.py


+ 4 - 2
desktop/core/ext-py/Mako-0.3.3/mako/template.py → desktop/core/ext-py/Mako-0.3.4/mako/template.py

@@ -363,7 +363,8 @@ def _compile_text(template, text, filename):
                             buffer_filters=template.buffer_filters, 
                             imports=template.imports, 
                             source_encoding=lexer.encoding,
-                            generate_magic_comment=template.disable_unicode)
+                            generate_magic_comment=template.disable_unicode,
+                            disable_unicode=template.disable_unicode)
 
     cid = identifier
     if not util.py3k and isinstance(cid, unicode):
@@ -389,7 +390,8 @@ def _compile_module_file(template, text, filename, outputpath):
                                 buffer_filters=template.buffer_filters,
                                 imports=template.imports,
                                 source_encoding=lexer.encoding,
-                                generate_magic_comment=True)
+                                generate_magic_comment=True,
+                                disable_unicode=template.disable_unicode)
                                 
     # make tempfiles in the same location as the ultimate 
     # location.   this ensures they're on the same filesystem,

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/mako/util.py → desktop/core/ext-py/Mako-0.3.4/mako/util.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/scripts/mako-render → desktop/core/ext-py/Mako-0.3.4/scripts/mako-render


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/setup.cfg → desktop/core/ext-py/Mako-0.3.4/setup.cfg


+ 1 - 0
desktop/core/ext-py/Mako-0.3.3/setup.py → desktop/core/ext-py/Mako-0.3.4/setup.py

@@ -48,6 +48,7 @@ ties to Python calling and scoping semantics.
       zip_safe=False,
       install_requires=[
           'Beaker>=1.1',
+          'MarkupSafe>=0.9.2',
       ],
       entry_points="""
       [python.templating.engines]

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/__init__.py → desktop/core/ext-py/Mako-0.3.4/test/__init__.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/foo/__init__.py → desktop/core/ext-py/Mako-0.3.4/test/foo/__init__.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/foo/test_ns.py → desktop/core/ext-py/Mako-0.3.4/test/foo/test_ns.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/sample_module_namespace.py → desktop/core/ext-py/Mako-0.3.4/test/sample_module_namespace.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/badbom.html → desktop/core/ext-py/Mako-0.3.4/test/templates/badbom.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/bom.html → desktop/core/ext-py/Mako-0.3.4/test/templates/bom.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/bommagic.html → desktop/core/ext-py/Mako-0.3.4/test/templates/bommagic.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/chs_unicode.html → desktop/core/ext-py/Mako-0.3.4/test/templates/chs_unicode.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/chs_unicode_py3k.html → desktop/core/ext-py/Mako-0.3.4/test/templates/chs_unicode_py3k.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/chs_utf8.html → desktop/core/ext-py/Mako-0.3.4/test/templates/chs_utf8.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/crlf.html → desktop/core/ext-py/Mako-0.3.4/test/templates/crlf.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/foo/modtest.html.py → desktop/core/ext-py/Mako-0.3.4/test/templates/foo/modtest.html.py


+ 83 - 0
desktop/core/ext-py/Mako-0.3.4/test/templates/gettext.mako

@@ -0,0 +1,83 @@
+<%page args="x, y=_('Page arg 1'), z=_('Page arg 2')"/>
+<%!
+import random
+def gettext(message): return message
+_ = gettext
+def ungettext(s, p, c):
+    if c == 1:
+        return s
+    return p
+top = gettext('Begin')
+%>
+<%
+   # TRANSLATOR: Hi there!
+   hithere = _('Hi there!')
+
+   # TRANSLATOR: you should not be seeing this in the .po
+   rows = [[v for v in range(0,10)] for row in range(0,10)]
+
+   hello = _('Hello')
+%>
+<div id="header">
+  ${_('Welcome')}
+</div>
+<table>
+    % for row in (hithere, hello, _('Yo')):
+        ${makerow(row)}
+    % endfor
+    ${makerow(count=2)}
+</table>
+
+
+<div id="main">
+
+## TRANSLATOR: Ensure so and
+## so, thanks
+  ${_('The')} fuzzy ${ungettext('bunny', 'bunnies', random.randint(1, 2))}
+</div>
+
+<div id="footer">
+  ## TRANSLATOR: Good bye
+  ${_('Goodbye')}
+</div>
+   
+<%def name="makerow(row=_('Babel'), count=1)">
+    <!-- ${ungettext('hella', 'hellas', count)} -->
+    % for i in range(count):
+      <tr>
+      % for name in row:
+          <td>${name}</td>\
+      % endfor
+      </tr>
+    % endfor
+</%def>
+
+<%def name="comment()">
+  <!-- ${caller.body()} -->
+</%def>
+
+<%call expr="comment">
+  P.S.
+  ## TRANSLATOR: HTML comment
+  ${_('Goodbye, really!')}
+</%call>
+
+<!-- ${_('P.S. byebye')} -->
+
+<div id="end">
+  <a href="#top">
+    ## TRANSLATOR: you won't see this either
+    
+    ${_('Top')}
+  </a>
+</div>
+
+<%def name="panel()">
+
+${_(u'foo')} <%self:block_tpl title="123", name="_(u'baz')">
+
+${_(u'bar')}
+
+</%self:block_tpl>
+
+</%def>

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/index.html → desktop/core/ext-py/Mako-0.3.4/test/templates/index.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/internationalization.html → desktop/core/ext-py/Mako-0.3.4/test/templates/internationalization.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/modtest.html → desktop/core/ext-py/Mako-0.3.4/test/templates/modtest.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/read_unicode.html → desktop/core/ext-py/Mako-0.3.4/test/templates/read_unicode.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/read_unicode_py3k.html → desktop/core/ext-py/Mako-0.3.4/test/templates/read_unicode_py3k.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/runtimeerr.html → desktop/core/ext-py/Mako-0.3.4/test/templates/runtimeerr.html


+ 4 - 0
desktop/core/ext-py/Mako-0.3.4/test/templates/runtimeerr_py3k.html

@@ -0,0 +1,4 @@
+<%
+    print(y)
+    y = 10
+%>

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/subdir/foo/modtest.html.py → desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/foo/modtest.html.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/subdir/incl.html → desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/incl.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/subdir/index.html → desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/index.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/subdir/modtest.html → desktop/core/ext-py/Mako-0.3.4/test/templates/subdir/modtest.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_arguments.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_arguments.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_arguments_py3k.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_arguments_py3k.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_code.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_code.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_code_py3k.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_code_py3k.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_expr.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_expr.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_expr_py3k.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_expr_py3k.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_runtime_error.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_runtime_error.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/templates/unicode_syntax_error.html → desktop/core/ext-py/Mako-0.3.4/test/templates/unicode_syntax_error.html


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_ast.py → desktop/core/ext-py/Mako-0.3.4/test/test_ast.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_babelplugin.py → desktop/core/ext-py/Mako-0.3.4/test/test_babelplugin.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_cache.py → desktop/core/ext-py/Mako-0.3.4/test/test_cache.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_call.py → desktop/core/ext-py/Mako-0.3.4/test/test_call.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_decorators.py → desktop/core/ext-py/Mako-0.3.4/test/test_decorators.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_def.py → desktop/core/ext-py/Mako-0.3.4/test/test_def.py


+ 28 - 15
desktop/core/ext-py/Mako-0.3.3/test/test_exceptions.py → desktop/core/ext-py/Mako-0.3.4/test/test_exceptions.py

@@ -17,12 +17,12 @@ class ExceptionsTest(TemplateTest):
         try:
             template = Template(code)
             template.render_unicode()
+            assert False
         except exceptions.CompileException, ce:
             html_error = exceptions.html_error_template().render_unicode()
             assert ("CompileException: Fragment 'i = 0' is not a partial "
                     "control statement") in html_error
             assert '<style>' in html_error
-            assert '</style>' in html_error
             html_error_stripped = html_error.strip()
             assert html_error_stripped.startswith('<html>')
             assert html_error_stripped.endswith('</html>')
@@ -30,18 +30,30 @@ class ExceptionsTest(TemplateTest):
             not_full = exceptions.html_error_template().\
                                     render_unicode(full=False)
             assert '<html>' not in not_full
-            assert '</html>' not in not_full
             assert '<style>' in not_full
-            assert '</style>' in not_full
 
             no_css = exceptions.html_error_template().\
                                     render_unicode(css=False)
             assert '<style>' not in no_css
-            assert '</style>' not in no_css
         else:
             assert False, ("This function should trigger a CompileException, "
                            "but didn't")
 
+    def test_text_error_template(self):
+        code = """
+% i = 0
+"""
+        try:
+            template = Template(code)
+            template.render_unicode()
+            assert False
+        except exceptions.CompileException, ce:
+            text_error = exceptions.text_error_template().render_unicode()
+            assert 'Traceback (most recent call last):' in text_error
+            assert ("CompileException: Fragment 'i = 0' is not a partial "
+                    "control statement") in text_error
+
+        
     def test_utf8_html_error_template(self):
         """test the html_error_template with a Template containing utf8
         chars"""
@@ -69,10 +81,10 @@ ${u'привет'}
                     html_error.decode('utf-8')
                     
             if util.py3k:
-                assert u"3 ${'привет'}".encode(sys.getdefaultencoding(),
+                assert u"3 ${&#39;привет&#39;}".encode(sys.getdefaultencoding(),
                                             'htmlentityreplace') in html_error
             else:
-                assert u"3 ${u'привет'}".encode(sys.getdefaultencoding(),
+                assert u"3 ${u&#39;привет&#39;}".encode(sys.getdefaultencoding(),
                                             'htmlentityreplace') in html_error
         else:
             assert False, ("This function should trigger a CompileException, "
@@ -86,7 +98,7 @@ ${u'привет'}
             foo()
         except:
             html_error = exceptions.html_error_template().render()
-            assert "RuntimeError: test" in html_error
+            assert "RuntimeError: test" in str(html_error)
         
     def test_py_utf8_html_error_template(self):
         try:
@@ -96,10 +108,10 @@ ${u'привет'}
             html_error = exceptions.html_error_template().render()
             if util.py3k:
                 assert 'RuntimeError: test' in html_error.decode('utf-8')
-                assert u"foo = '日本'" in html_error.decode('utf-8')
+                assert u"foo = &#39;日本&#39;" in html_error.decode('utf-8')
             else:
                 assert 'RuntimeError: test' in html_error
-                assert "foo = u'&#x65E5;&#x672C;'" in html_error
+                assert "foo = u&#39;&#x65E5;&#x672C;&#39;" in html_error
 
     def test_py_unicode_error_html_error_template(self):
         try:
@@ -134,11 +146,11 @@ ${foobar}
             l.put_string("foo.html", """# -*- coding: utf-8 -*-\n${u'привет' + foobar}""")
 
         if util.py3k:
-            assert u'<div class="sourceline">${\'привет\' + foobar}</div>'\
+            assert u'<div class="sourceline">${&#39;привет&#39; + foobar}</div>'\
                 in result_lines(l.get_template("foo.html").render().decode('utf-8'))
         else:
-            assert '<div class="highlight">2 ${u\'&#x43F;&#x440;'\
-                    '&#x438;&#x432;&#x435;&#x442;\' + foobar}</div>' \
+            assert '<div class="highlight">2 ${u&#39;&#x43F;&#x440;'\
+                    '&#x438;&#x432;&#x435;&#x442;&#39; + foobar}</div>' \
                 in result_lines(l.get_template("foo.html").render().decode('utf-8'))
         
     
@@ -157,7 +169,7 @@ ${foobar}
         
         # obfuscate the text so that this text
         # isn't in the 'wrong' exception
-        assert "".join(reversed(")'rab'(oof")) in html_error
+        assert "".join(reversed(");93#&rab;93#&(oof")) in html_error
 
     def test_tback_no_trace(self):
         try:
@@ -166,8 +178,9 @@ ${foobar}
         except:
             t, v, tback = sys.exc_info()
 
-        # blow away tracebaack info
-        sys.exc_clear()
+        if not util.py3k:
+            # blow away tracebaack info
+            sys.exc_clear()
         
         # and don't even send what we have.
         html_error = exceptions.html_error_template().\

+ 25 - 1
desktop/core/ext-py/Mako-0.3.3/test/test_filters.py → desktop/core/ext-py/Mako-0.3.4/test/test_filters.py

@@ -2,9 +2,11 @@
 
 from mako.template import Template
 import unittest
+from mako import util
+from test import TemplateTest, eq_, skip_if
 from util import result_lines, flatten_result
 
-class FilterTest(unittest.TestCase):
+class FilterTest(TemplateTest):
     def test_basic(self):
         t = Template("""
         ${x | myfilter}
@@ -26,7 +28,29 @@ class FilterTest(unittest.TestCase):
             ${x | trim}
         """)
         assert flatten_result(t.render(x=5)) == "5"
+    
+    def test_quoting(self):
+        t = Template("""
+            foo ${bar | h}
+        """)
+        
+        eq_(
+            flatten_result(t.render(bar="<'some bar'>")),
+            "foo &lt;&#39;some bar&#39;&gt;"
+        )
+    
+    @skip_if(lambda: util.py3k)
+    def test_quoting_non_unicode(self):
+        t = Template("""
+            foo ${bar | h}
+        """, disable_unicode=True)
 
+        eq_(
+            flatten_result(t.render(bar="<'привет'>")),
+            "foo &lt;&#39;привет&#39;&gt;"
+        )
+        
+        
     def test_def(self):
         t = Template("""
             <%def name="foo()" filter="myfilter">

+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_inheritance.py → desktop/core/ext-py/Mako-0.3.4/test/test_inheritance.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_lexer.py → desktop/core/ext-py/Mako-0.3.4/test/test_lexer.py


+ 0 - 0
desktop/core/ext-py/Mako-0.3.3/test/test_lookup.py → desktop/core/ext-py/Mako-0.3.4/test/test_lookup.py


Some files were not shown because too many files changed in this diff