Browse Source

AMBARI-7138. Ambari RPM deals with jinja2 dependency incorrectly (aonishuk)

Andrew Onishuk 11 năm trước cách đây
mục cha
commit
7c3ea59fc0
100 tập tin đã thay đổi với 322 bổ sung319 xóa
  1. 6 6
      ambari-agent/pom.xml
  2. 1 1
      ambari-agent/src/test/python/resource_management/TestContentSources.py
  3. 0 0
      ambari-common/src/main/python/ambari_jinja2/AUTHORS
  4. 2 2
      ambari-common/src/main/python/ambari_jinja2/CHANGES
  5. 0 0
      ambari-common/src/main/python/ambari_jinja2/LICENSE
  6. 4 4
      ambari-common/src/main/python/ambari_jinja2/MANIFEST.in
  7. 0 0
      ambari-common/src/main/python/ambari_jinja2/Makefile
  8. 8 8
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/__init__.py
  9. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_debugsupport.c
  10. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/__init__.py
  11. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_bundle.py
  12. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_constants.py
  13. 1 1
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_native.py
  14. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/tests.py
  15. 1 1
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_stringdefs.py
  16. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/bccache.py
  17. 8 8
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/compiler.py
  18. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/constants.py
  19. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/debug.py
  20. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/defaults.py
  21. 16 16
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/environment.py
  22. 1 1
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/exceptions.py
  23. 12 12
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/ext.py
  24. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/filters.py
  25. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/lexer.py
  26. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/loaders.py
  27. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/meta.py
  28. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/nodes.py
  29. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/optimizer.py
  30. 7 7
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/parser.py
  31. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/runtime.py
  32. 7 7
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/sandbox.py
  33. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/tests.py
  34. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/__init__.py
  35. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/api.py
  36. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/core_tags.py
  37. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/debug.py
  38. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/doctests.py
  39. 25 25
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/ext.py
  40. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/filters.py
  41. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/imports.py
  42. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/inheritance.py
  43. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/lexnparse.py
  44. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/loader.py
  45. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/regression.py
  46. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/broken.html
  47. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/foo/test.html
  48. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/syntaxerror.html
  49. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/test.html
  50. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/security.py
  51. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/tests.py
  52. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/utils.py
  53. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/utils.py
  54. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/visitor.py
  55. 2 2
      ambari-common/src/main/python/ambari_jinja2/artwork/jinjalogo.svg
  56. 0 0
      ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_alt_unicode.py
  57. 0 0
      ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_broken_reraising.py
  58. 0 0
      ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_xrange2.py
  59. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/Makefile
  60. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_static/jinja.js
  61. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_static/print.css
  62. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_static/style.css
  63. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/genindex.html
  64. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/layout.html
  65. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/opensearch.xml
  66. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/page.html
  67. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/search.html
  68. 40 40
      ambari-common/src/main/python/ambari_jinja2/docs/api.rst
  69. 2 2
      ambari-common/src/main/python/ambari_jinja2/docs/cache_extension.py
  70. 3 0
      ambari-common/src/main/python/ambari_jinja2/docs/changelog.rst
  71. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/conf.py
  72. 23 23
      ambari-common/src/main/python/ambari_jinja2/docs/extensions.rst
  73. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/faq.rst
  74. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/index.rst
  75. 4 4
      ambari-common/src/main/python/ambari_jinja2/docs/integration.rst
  76. 8 8
      ambari-common/src/main/python/ambari_jinja2/docs/intro.rst
  77. 4 4
      ambari-common/src/main/python/ambari_jinja2/docs/jinjaext.py
  78. 1 1
      ambari-common/src/main/python/ambari_jinja2/docs/sandbox.rst
  79. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/switching.rst
  80. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/templates.rst
  81. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/tricks.rst
  82. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/basic/cycle.py
  83. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/debugger.py
  84. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/inheritance.py
  85. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/broken.html
  86. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/subbroken.html
  87. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/test.py
  88. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/basic/test_filter_and_linestatements.py
  89. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/basic/test_loop_filter.py
  90. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/translate.py
  91. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/bench.py
  92. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/profile.py
  93. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_form.html
  94. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_input_field.html
  95. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_textarea.html
  96. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/index.html
  97. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/layout.html
  98. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/djangoext.py
  99. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/genshi/helpers.html
  100. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/genshi/index.html

+ 6 - 6
ambari-agent/pom.xml

@@ -40,7 +40,7 @@
     <agent.install.dir>/usr/lib/python2.6/site-packages/ambari_agent</agent.install.dir>
     <ambari_commons.install.dir>/usr/lib/ambari-agent/lib/ambari_commons</ambari_commons.install.dir>
     <resource_management.install.dir>/usr/lib/ambari-agent/lib/resource_management</resource_management.install.dir>
-    <jinja.install.dir>/usr/lib/python2.6/site-packages/jinja2</jinja.install.dir>
+    <jinja.install.dir>/usr/lib/python2.6/site-packages/ambari_jinja2</jinja.install.dir>
     <lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
     <python.ver>python &gt;= 2.6</python.ver>
     <deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
@@ -115,7 +115,7 @@
                 <argument>unitTests.py</argument>
               </arguments>
               <environmentVariables>
-                <PYTHONPATH>${project.basedir}/../ambari-common/src/main/python/jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH</PYTHONPATH>
+                <PYTHONPATH>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH</PYTHONPATH>
               </environmentVariables>
               <skip>${skipTests}</skip>
             </configuration>
@@ -255,9 +255,9 @@
               <groupname>root</groupname>
               <sources>
                 <source>
-                  <location>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2</location>
+                  <location>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2</location>
                   <excludes>
-                    <exclude>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2/testsuite</exclude>
+                    <exclude>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite</exclude>
                   </excludes>
                 </source>
               </sources>
@@ -413,8 +413,8 @@
               </mapper>
             </data>
             <data>
-              <src>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2</src>
-              <excludes>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2/testsuite</excludes>
+              <src>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2</src>
+              <excludes>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite</excludes>
               <type>directory</type>
               <mapper>
                 <type>perm</type>

+ 1 - 1
ambari-agent/src/test/python/resource_management/TestContentSources.py

@@ -27,7 +27,7 @@ from resource_management.core.source import DownloadSource
 from resource_management.core.source import Template
 from resource_management.core.source import InlineTemplate
 
-from jinja2 import UndefinedError, TemplateNotFound
+from ambari_jinja2 import UndefinedError, TemplateNotFound
 import urllib2
 import os
 

+ 0 - 0
ambari-common/src/main/python/jinja2/AUTHORS → ambari-common/src/main/python/ambari_jinja2/AUTHORS


+ 2 - 2
ambari-common/src/main/python/jinja2/CHANGES → ambari-common/src/main/python/ambari_jinja2/CHANGES

@@ -205,7 +205,7 @@ Version 2.0
   slightly.  It's now possible to give attributes or items a higher priority
   by either using dot-notation lookup or the bracket syntax.  This also
   changed the AST slightly.  `Subscript` is gone and was replaced with
-  :class:`~jinja2.nodes.Getitem` and :class:`~jinja2.nodes.Getattr`.
+  :class:`~ambari_jinja2.nodes.Getitem` and :class:`~ambari_jinja2.nodes.Getattr`.
 
   For more information see :ref:`the implementation details <notes-on-subscriptions>`.
 
@@ -213,7 +213,7 @@ Version 2.0
   This would allow extensions to allow simplified gettext calls in template
   data and something similar.
 
-- added :meth:`jinja2.environment.TemplateStream.dump`.
+- added :meth:`ambari_jinja2.environment.TemplateStream.dump`.
 
 - added missing support for implicit string literal concatenation.
   ``{{ "foo" "bar" }}`` is equivalent to ``{{ "foobar" }}``

+ 0 - 0
ambari-common/src/main/python/jinja2/LICENSE → ambari-common/src/main/python/ambari_jinja2/LICENSE


+ 4 - 4
ambari-common/src/main/python/jinja2/MANIFEST.in → ambari-common/src/main/python/ambari_jinja2/MANIFEST.in

@@ -1,12 +1,12 @@
-include MANIFEST.in Makefile CHANGES LICENSE AUTHORS jinja2/_debugsupport.c
+include MANIFEST.in Makefile CHANGES LICENSE AUTHORS ambari_jinja2/_debugsupport.c
 recursive-include docs *
 recursive-include custom_fixers *
 recursive-include ext *
 recursive-include artwork *
 recursive-include examples *
-recursive-include jinja2/testsuite/res *
+recursive-include ambari_jinja2/testsuite/res *
 recursive-exclude docs/_build *
-recursive-exclude jinja2 *.pyc
+recursive-exclude ambari_jinja2 *.pyc
 recursive-exclude docs *.pyc
-recursive-exclude jinja2 *.pyo
+recursive-exclude ambari_jinja2 *.pyo
 recursive-exclude docs *.pyo

+ 0 - 0
ambari-common/src/main/python/jinja2/Makefile → ambari-common/src/main/python/ambari_jinja2/Makefile


+ 8 - 8
ambari-common/src/main/python/jinja2/jinja2/__init__.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/__init__.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2
+    ambari_jinja2
     ~~~~~~
 
     Jinja2 is a template engine written in pure Python.  It provides a
@@ -34,29 +34,29 @@ except:
     __version__ = 'unknown'
 
 # high level interface
-from jinja2.environment import Environment, Template
+from ambari_jinja2.environment import Environment, Template
 
 # loaders
-from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
+from ambari_jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
      DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
      ModuleLoader
 
 # bytecode caches
-from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
+from ambari_jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
      MemcachedBytecodeCache
 
 # undefined types
-from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
+from ambari_jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
 
 # exceptions
-from jinja2.exceptions import TemplateError, UndefinedError, \
+from ambari_jinja2.exceptions import TemplateError, UndefinedError, \
      TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
      TemplateAssertionError
 
 # decorators and public utilities
-from jinja2.filters import environmentfilter, contextfilter, \
+from ambari_jinja2.filters import environmentfilter, contextfilter, \
      evalcontextfilter
-from jinja2.utils import Markup, escape, clear_caches, \
+from ambari_jinja2.utils import Markup, escape, clear_caches, \
      environmentfunction, evalcontextfunction, contextfunction, \
      is_undefined
 

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/_debugsupport.c → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_debugsupport.c

@@ -1,5 +1,5 @@
 /**
- * jinja2._debugsupport
+ * ambari_jinja2._debugsupport
  * ~~~~~~~~~~~~~~~~~~~~
  *
  * C implementation of `tb_set_next`.
@@ -52,14 +52,14 @@ static PyMethodDef module_methods[] = {
 PyMODINIT_FUNC
 init_debugsupport(void)
 {
-	Py_InitModule3("jinja2._debugsupport", module_methods, "");
+	Py_InitModule3("ambari_jinja2._debugsupport", module_methods, "");
 }
 
 #else /* Python 3.x module initialization */
 
 static struct PyModuleDef module_definition = {
         PyModuleDef_HEAD_INIT,
-	"jinja2._debugsupport",
+	"ambari_jinja2._debugsupport",
 	NULL,
 	-1,
 	module_methods,

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/__init__.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/__init__.py

@@ -126,7 +126,7 @@ class Markup(unicode):
         >>> Markup("Main &raquo; <em>About</em>").unescape()
         u'Main \xbb <em>About</em>'
         """
-        from jinja2._markupsafe._constants import HTML_ENTITIES
+        from ambari_jinja2._markupsafe._constants import HTML_ENTITIES
         def handle_match(m):
             name = m.group(1)
             if name in HTML_ENTITIES:
@@ -220,6 +220,6 @@ class _MarkupEscapeHelper(object):
 # we have to import it down here as the speedups and native
 # modules imports the markup type which is define above.
 try:
-    from jinja2._markupsafe._speedups import escape, escape_silent, soft_unicode
+    from ambari_jinja2._markupsafe._speedups import escape, escape_silent, soft_unicode
 except ImportError:
-    from jinja2._markupsafe._native import escape, escape_silent, soft_unicode
+    from ambari_jinja2._markupsafe._native import escape, escape_silent, soft_unicode

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/_bundle.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_bundle.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2._markupsafe._bundle
+    ambari_jinja2._markupsafe._bundle
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     This script pulls in markupsafe from a source folder and
@@ -18,7 +18,7 @@ import re
 def rewrite_imports(lines):
     for idx, line in enumerate(lines):
         new_line = re.sub(r'(import|from)\s+markupsafe\b',
-                          r'\1 jinja2._markupsafe', line)
+                          r'\1 ambari_jinja2._markupsafe', line)
         if new_line != line:
             lines[idx] = new_line
 

+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/_constants.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_constants.py


+ 1 - 1
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/_native.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_native.py

@@ -8,7 +8,7 @@
     :copyright: (c) 2010 by Armin Ronacher.
     :license: BSD, see LICENSE for more details.
 """
-from jinja2._markupsafe import Markup
+from ambari_jinja2._markupsafe import Markup
 
 
 def escape(s):

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/tests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/tests.py

@@ -1,6 +1,6 @@
 import gc
 import unittest
-from jinja2._markupsafe import Markup, escape, escape_silent
+from ambari_jinja2._markupsafe import Markup, escape, escape_silent
 
 
 class MarkupTestCase(unittest.TestCase):
@@ -41,7 +41,7 @@ class MarkupTestCase(unittest.TestCase):
         assert Markup("&lt;test&gt;").unescape() == "<test>"
 
     def test_all_set(self):
-        import jinja2._markupsafe as markup
+        import ambari_jinja2._markupsafe as markup
         for item in markup.__all__:
             getattr(markup, item)
 

+ 1 - 1
ambari-common/src/main/python/jinja2/jinja2/_stringdefs.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_stringdefs.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2._stringdefs
+    ambari_jinja2._stringdefs
     ~~~~~~~~~~~~~~~~~~
 
     Strings of all Unicode characters of a certain category.

+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/bccache.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/bccache.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.bccache
+    ambari_jinja2.bccache
     ~~~~~~~~~~~~~~
 
     This module implements the bytecode cache system Jinja is optionally
@@ -24,7 +24,7 @@ try:
     from hashlib import sha1
 except ImportError:
     from sha import new as sha1
-from jinja2.utils import open_if_exists
+from ambari_jinja2.utils import open_if_exists
 
 
 bc_version = 1
@@ -94,7 +94,7 @@ class Bucket(object):
 class BytecodeCache(object):
     """To implement your own bytecode cache you have to subclass this class
     and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of
-    these methods are passed a :class:`~jinja2.bccache.Bucket`.
+    these methods are passed a :class:`~ambari_jinja2.bccache.Bucket`.
 
     A very basic bytecode cache that saves the bytecode on the file system::
 
@@ -176,7 +176,7 @@ class FileSystemBytecodeCache(BytecodeCache):
     If no directory is specified the system temporary items folder is used.
 
     The pattern can be used to have multiple separate caches operate on the
-    same directory.  The default pattern is ``'__jinja2_%s.cache'``.  ``%s``
+    same directory.  The default pattern is ``'__ambari_jinja2_%s.cache'``.  ``%s``
     is replaced with the cache key.
 
     >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
@@ -184,7 +184,7 @@ class FileSystemBytecodeCache(BytecodeCache):
     This bytecode cache supports clearing of the cache using the clear method.
     """
 
-    def __init__(self, directory=None, pattern='__jinja2_%s.cache'):
+    def __init__(self, directory=None, pattern='__ambari_jinja2_%s.cache'):
         if directory is None:
             directory = tempfile.gettempdir()
         self.directory = directory
@@ -263,7 +263,7 @@ class MemcachedBytecodeCache(BytecodeCache):
     The clear method is a no-operation function.
     """
 
-    def __init__(self, client, prefix='jinja2/bytecode/', timeout=None):
+    def __init__(self, client, prefix='ambari_jinja2/bytecode/', timeout=None):
         self.client = client
         self.prefix = prefix
         self.timeout = timeout

+ 8 - 8
ambari-common/src/main/python/jinja2/jinja2/compiler.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/compiler.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.compiler
+    ambari_jinja2.compiler
     ~~~~~~~~~~~~~~~
 
     Compiles nodes into python code.
@@ -11,11 +11,11 @@
 from cStringIO import StringIO
 from itertools import chain
 from copy import deepcopy
-from jinja2 import nodes
-from jinja2.nodes import EvalContext
-from jinja2.visitor import NodeVisitor, NodeTransformer
-from jinja2.exceptions import TemplateAssertionError
-from jinja2.utils import Markup, concat, escape, is_python_keyword, next
+from ambari_jinja2 import nodes
+from ambari_jinja2.nodes import EvalContext
+from ambari_jinja2.visitor import NodeVisitor, NodeTransformer
+from ambari_jinja2.exceptions import TemplateAssertionError
+from ambari_jinja2.utils import Markup, concat, escape, is_python_keyword, next
 
 
 operators = {
@@ -763,9 +763,9 @@ class CodeGenerator(NodeVisitor):
         assert frame is None, 'no root frame allowed'
         eval_ctx = EvalContext(self.environment, self.name)
 
-        from jinja2.runtime import __all__ as exported
+        from ambari_jinja2.runtime import __all__ as exported
         self.writeline('from __future__ import division')
-        self.writeline('from jinja2.runtime import ' + ', '.join(exported))
+        self.writeline('from ambari_jinja2.runtime import ' + ', '.join(exported))
         if not unoptimize_before_dead_code:
             self.writeline('dummy = lambda *x: None')
 

+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/constants.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/constants.py


+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/debug.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/debug.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.debug
+    ambari_jinja2.debug
     ~~~~~~~~~~~~
 
     Implements the debug interface for Jinja.  This module does some pretty
@@ -12,8 +12,8 @@
 """
 import sys
 import traceback
-from jinja2.utils import CodeType, missing, internal_code
-from jinja2.exceptions import TemplateSyntaxError
+from ambari_jinja2.utils import CodeType, missing, internal_code
+from ambari_jinja2.exceptions import TemplateSyntaxError
 
 
 # how does the raise helper look like?
@@ -76,7 +76,7 @@ class ProcessedTraceback(object):
 
     def render_as_html(self, full=False):
         """Return a unicode string with the traceback as rendered HTML."""
-        from jinja2.debugrenderer import render_traceback
+        from ambari_jinja2.debugrenderer import render_traceback
         return u'%s\n\n<!--\n%s\n-->' % (
             render_traceback(self, full=full),
             self.render_as_text().decode('utf-8', 'replace')
@@ -299,7 +299,7 @@ def _init_ugly_crap():
 
 # try to get a tb_set_next implementation
 try:
-    from jinja2._debugsupport import tb_set_next
+    from ambari_jinja2._debugsupport import tb_set_next
 except ImportError:
     try:
         tb_set_next = _init_ugly_crap()

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/defaults.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/defaults.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.defaults
+    ambari_jinja2.defaults
     ~~~~~~~~~~~~~~~
 
     Jinja default filters and tags.
@@ -8,7 +8,7 @@
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD, see LICENSE for more details.
 """
-from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
+from ambari_jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
 
 
 # defaults for the parser / lexer
@@ -25,8 +25,8 @@ NEWLINE_SEQUENCE = '\n'
 
 
 # default filters, tests and namespace
-from jinja2.filters import FILTERS as DEFAULT_FILTERS
-from jinja2.tests import TESTS as DEFAULT_TESTS
+from ambari_jinja2.filters import FILTERS as DEFAULT_FILTERS
+from ambari_jinja2.tests import TESTS as DEFAULT_TESTS
 DEFAULT_NAMESPACE = {
     'range':        xrange,
     'dict':         lambda **kw: kw,

+ 16 - 16
ambari-common/src/main/python/jinja2/jinja2/environment.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/environment.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.environment
+    ambari_jinja2.environment
     ~~~~~~~~~~~~~~~~~~
 
     Provides a class that holds runtime and parsing time options.
@@ -10,16 +10,16 @@
 """
 import os
 import sys
-from jinja2 import nodes
-from jinja2.defaults import *
-from jinja2.lexer import get_lexer, TokenStream
-from jinja2.parser import Parser
-from jinja2.optimizer import optimize
-from jinja2.compiler import generate
-from jinja2.runtime import Undefined, new_context
-from jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \
+from ambari_jinja2 import nodes
+from ambari_jinja2.defaults import *
+from ambari_jinja2.lexer import get_lexer, TokenStream
+from ambari_jinja2.parser import Parser
+from ambari_jinja2.optimizer import optimize
+from ambari_jinja2.compiler import generate
+from ambari_jinja2.runtime import Undefined, new_context
+from ambari_jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \
      TemplatesNotFound
-from jinja2.utils import import_string, LRUCache, Markup, missing, \
+from ambari_jinja2.utils import import_string, LRUCache, Markup, missing, \
      concat, consume, internalcode, _encode_filename
 
 
@@ -160,7 +160,7 @@ class Environment(object):
         `autoescape`
             If set to true the XML/HTML autoescaping feature is enabled by
             default.  For more details about auto escaping see
-            :class:`~jinja2.utils.Markup`.  As of Jinja 2.4 this can also
+            :class:`~ambari_jinja2.utils.Markup`.  As of Jinja 2.4 this can also
             be a callable that is passed the template name and has to
             return `True` or `False` depending on autoescape should be
             enabled by default.
@@ -196,7 +196,7 @@ class Environment(object):
 
     #: if this environment is sandboxed.  Modifying this variable won't make
     #: the environment sandboxed though.  For a real sandboxed environment
-    #: have a look at jinja2.sandbox
+    #: have a look at ambari_jinja2.sandbox
     sandboxed = False
 
     #: True if the environment is just an overlay
@@ -423,7 +423,7 @@ class Environment(object):
 
     def _tokenize(self, source, name, filename=None, state=None):
         """Called by the parser to do the preprocessing and filtering
-        for all the extensions.  Returns a :class:`~jinja2.lexer.TokenStream`.
+        for all the extensions.  Returns a :class:`~ambari_jinja2.lexer.TokenStream`.
         """
         source = self.preprocess(source, name, filename)
         stream = self.lexer.tokenize(source, name, filename, state)
@@ -559,7 +559,7 @@ class Environment(object):
 
         .. versionadded:: 2.4
         """
-        from jinja2.loaders import ModuleLoader
+        from ambari_jinja2.loaders import ModuleLoader
 
         if log_function is None:
             log_function = lambda x: None
@@ -657,7 +657,7 @@ class Environment(object):
         # get any exceptions in template rendering there is no need to load
         # all of that.
         if _make_traceback is None:
-            from jinja2.debug import make_traceback as _make_traceback
+            from ambari_jinja2.debug import make_traceback as _make_traceback
         traceback = _make_traceback(exc_info, source_hint)
         if rendered and self.exception_formatter is not None:
             return self.exception_formatter(traceback)
@@ -1014,7 +1014,7 @@ class TemplateModule(object):
 
 
 class TemplateExpression(object):
-    """The :meth:`jinja2.Environment.compile_expression` method returns an
+    """The :meth:`ambari_jinja2.Environment.compile_expression` method returns an
     instance of this object.  It encapsulates the expression-like access
     to the template with an expression it wraps.
     """

+ 1 - 1
ambari-common/src/main/python/jinja2/jinja2/exceptions.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/exceptions.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.exceptions
+    ambari_jinja2.exceptions
     ~~~~~~~~~~~~~~~~~
 
     Jinja exceptions.

+ 12 - 12
ambari-common/src/main/python/jinja2/jinja2/ext.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/ext.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.ext
+    ambari_jinja2.ext
     ~~~~~~~~~~
 
     Jinja extensions allow to add custom tags similar to the way django custom
@@ -11,12 +11,12 @@
     :license: BSD.
 """
 from collections import deque
-from jinja2 import nodes
-from jinja2.defaults import *
-from jinja2.environment import Environment
-from jinja2.runtime import Undefined, concat
-from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
-from jinja2.utils import contextfunction, import_string, Markup, next
+from ambari_jinja2 import nodes
+from ambari_jinja2.defaults import *
+from ambari_jinja2.environment import Environment
+from ambari_jinja2.runtime import Undefined, concat
+from ambari_jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
+from ambari_jinja2.utils import contextfunction, import_string, Markup, next
 
 
 # the only real useful gettext functions for a Jinja template.  Note
@@ -82,10 +82,10 @@ class Extension(object):
         return source
 
     def filter_stream(self, stream):
-        """It's passed a :class:`~jinja2.lexer.TokenStream` that can be used
+        """It's passed a :class:`~ambari_jinja2.lexer.TokenStream` that can be used
         to filter tokens returned.  This method has to return an iterable of
-        :class:`~jinja2.lexer.Token`\s, but it doesn't have to return a
-        :class:`~jinja2.lexer.TokenStream`.
+        :class:`~ambari_jinja2.lexer.Token`\s, but it doesn't have to return a
+        :class:`~ambari_jinja2.lexer.TokenStream`.
 
         In the `ext` folder of the Jinja2 source distribution there is a file
         called `inlinegettext.py` which implements a filter that utilizes this
@@ -112,7 +112,7 @@ class Extension(object):
     def call_method(self, name, args=None, kwargs=None, dyn_args=None,
                     dyn_kwargs=None, lineno=None):
         """Call a method of the extension.  This is a shortcut for
-        :meth:`attr` + :class:`jinja2.nodes.Call`.
+        :meth:`attr` + :class:`ambari_jinja2.nodes.Call`.
         """
         if args is None:
             args = []
@@ -445,7 +445,7 @@ def extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,
 
     This example explains the behavior:
 
-    >>> from jinja2 import Environment
+    >>> from ambari_jinja2 import Environment
     >>> env = Environment()
     >>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}')
     >>> list(extract_from_ast(node))

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/filters.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/filters.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.filters
+    ambari_jinja2.filters
     ~~~~~~~~~~~~~~
 
     Bundled jinja filters.
@@ -13,9 +13,9 @@ import math
 from random import choice
 from operator import itemgetter
 from itertools import imap, groupby
-from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode
-from jinja2.runtime import Undefined
-from jinja2.exceptions import FilterArgumentError, SecurityError
+from ambari_jinja2.utils import Markup, escape, pformat, urlize, soft_unicode
+from ambari_jinja2.runtime import Undefined
+from ambari_jinja2.exceptions import FilterArgumentError, SecurityError
 
 
 _word_re = re.compile(r'\w+(?u)')

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/lexer.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/lexer.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.lexer
+    ambari_jinja2.lexer
     ~~~~~~~~~~~~
 
     This module implements a Jinja / Python combination lexer. The
@@ -17,8 +17,8 @@
 import re
 from operator import itemgetter
 from collections import deque
-from jinja2.exceptions import TemplateSyntaxError
-from jinja2.utils import LRUCache, next
+from ambari_jinja2.exceptions import TemplateSyntaxError
+from ambari_jinja2.utils import LRUCache, next
 
 
 # cache for the lexers. Exists in order to be able to have multiple
@@ -38,7 +38,7 @@ try:
 except SyntaxError:
     name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b')
 else:
-    from jinja2 import _stringdefs
+    from ambari_jinja2 import _stringdefs
     name_re = re.compile(r'[%s][%s]*' % (_stringdefs.xid_start,
                                          _stringdefs.xid_continue))
 
@@ -353,7 +353,7 @@ class TokenStream(object):
 
     def expect(self, expr):
         """Expect a given token type and return it.  This accepts the same
-        argument as :meth:`jinja2.lexer.Token.test`.
+        argument as :meth:`ambari_jinja2.lexer.Token.test`.
         """
         if not self.current.test(expr):
             expr = describe_token_expr(expr)

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/loaders.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/loaders.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.loaders
+    ambari_jinja2.loaders
     ~~~~~~~~~~~~~~
 
     Jinja loader classes.
@@ -17,8 +17,8 @@ try:
     from hashlib import sha1
 except ImportError:
     from sha import new as sha1
-from jinja2.exceptions import TemplateNotFound
-from jinja2.utils import LRUCache, open_if_exists, internalcode
+from ambari_jinja2.exceptions import TemplateNotFound
+from ambari_jinja2.utils import LRUCache, open_if_exists, internalcode
 
 
 def split_template_path(template):
@@ -45,7 +45,7 @@ class BaseLoader(object):
     A very basic example for a loader that looks up templates on the file
     system could look like this::
 
-        from jinja2 import BaseLoader, TemplateNotFound
+        from ambari_jinja2 import BaseLoader, TemplateNotFound
         from os.path import join, exists, getmtime
 
         class MyLoader(BaseLoader):
@@ -402,7 +402,7 @@ class ModuleLoader(BaseLoader):
     has_source_access = False
 
     def __init__(self, path):
-        package_name = '_jinja2_module_templates_%x' % id(self)
+        package_name = '_ambari_jinja2_module_templates_%x' % id(self)
 
         # create a fake module that looks for the templates in the
         # path given.

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/meta.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/meta.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.meta
+    ambari_jinja2.meta
     ~~~~~~~~~~~
 
     This module implements various functions that exposes information about
@@ -9,8 +9,8 @@
     :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
-from jinja2 import nodes
-from jinja2.compiler import CodeGenerator
+from ambari_jinja2 import nodes
+from ambari_jinja2.compiler import CodeGenerator
 
 
 class TrackingCodeGenerator(CodeGenerator):
@@ -35,7 +35,7 @@ def find_undeclared_variables(ast):
     variables will be used depending on the path the execution takes at
     runtime, all variables are returned.
 
-    >>> from jinja2 import Environment, meta
+    >>> from ambari_jinja2 import Environment, meta
     >>> env = Environment()
     >>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
     >>> meta.find_undeclared_variables(ast)
@@ -59,7 +59,7 @@ def find_referenced_templates(ast):
     imports.  If dynamic inheritance or inclusion is used, `None` will be
     yielded.
 
-    >>> from jinja2 import Environment, meta
+    >>> from ambari_jinja2 import Environment, meta
     >>> env = Environment()
     >>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
     >>> list(meta.find_referenced_templates(ast))

+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/nodes.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/nodes.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.nodes
+    ambari_jinja2.nodes
     ~~~~~~~~~~~~
 
     This module implements additional nodes derived from the ast base node.
@@ -15,7 +15,7 @@
 import operator
 from itertools import chain, izip
 from collections import deque
-from jinja2.utils import Markup, MethodType, FunctionType
+from ambari_jinja2.utils import Markup, MethodType, FunctionType
 
 
 #: the types we support for context functions
@@ -795,7 +795,7 @@ class ExtensionAttribute(Expr):
     The identifier is the identifier of the :class:`Extension`.
 
     This node is usually constructed by calling the
-    :meth:`~jinja2.ext.Extension.attr` method on an extension.
+    :meth:`~ambari_jinja2.ext.Extension.attr` method on an extension.
     """
     fields = ('identifier', 'name')
 
@@ -812,7 +812,7 @@ class ImportedName(Expr):
 class InternalName(Expr):
     """An internal name in the compiler.  You cannot create these nodes
     yourself but the parser provides a
-    :meth:`~jinja2.parser.Parser.free_identifier` method that creates
+    :meth:`~ambari_jinja2.parser.Parser.free_identifier` method that creates
     a new identifier for you.  This identifier is not available from the
     template and is not threated specially by the compiler.
     """
@@ -853,7 +853,7 @@ class MarkSafeIfAutoescape(Expr):
 class ContextReference(Expr):
     """Returns the current template context.  It can be used like a
     :class:`Name` node, with a ``'load'`` ctx and will return the
-    current :class:`~jinja2.runtime.Context` object.
+    current :class:`~ambari_jinja2.runtime.Context` object.
 
     Here an example that assigns the current template name to a
     variable named `foo`::
@@ -890,7 +890,7 @@ class EvalContextModifier(Stmt):
 class ScopedEvalContextModifier(EvalContextModifier):
     """Modifies the eval context and reverts it later.  Works exactly like
     :class:`EvalContextModifier` but will only modify the
-    :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
+    :class:`~ambari_jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
     """
     fields = ('body',)
 

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/optimizer.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/optimizer.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.optimizer
+    ambari_jinja2.optimizer
     ~~~~~~~~~~~~~~~~
 
     The jinja optimizer is currently trying to constant fold a few expressions
@@ -16,8 +16,8 @@
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD.
 """
-from jinja2 import nodes
-from jinja2.visitor import NodeTransformer
+from ambari_jinja2 import nodes
+from ambari_jinja2.visitor import NodeTransformer
 
 
 def optimize(node, environment):

+ 7 - 7
ambari-common/src/main/python/jinja2/jinja2/parser.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/parser.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.parser
+    ambari_jinja2.parser
     ~~~~~~~~~~~~~
 
     Implements the template parser.
@@ -8,10 +8,10 @@
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD, see LICENSE for more details.
 """
-from jinja2 import nodes
-from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
-from jinja2.utils import next
-from jinja2.lexer import describe_token, describe_token_expr
+from ambari_jinja2 import nodes
+from ambari_jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
+from ambari_jinja2.utils import next
+from ambari_jinja2.lexer import describe_token, describe_token_expr
 
 
 #: statements that callinto 
@@ -104,7 +104,7 @@ class Parser(object):
         return False
 
     def free_identifier(self, lineno=None):
-        """Return a new free identifier as :class:`~jinja2.nodes.InternalName`."""
+        """Return a new free identifier as :class:`~ambari_jinja2.nodes.InternalName`."""
         self._last_identifier += 1
         rv = object.__new__(nodes.InternalName)
         nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)
@@ -578,7 +578,7 @@ class Parser(object):
     def parse_tuple(self, simplified=False, with_condexpr=True,
                     extra_end_rules=None, explicit_parentheses=False):
         """Works like `parse_expression` but if multiple expressions are
-        delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.
+        delimited by a comma a :class:`~ambari_jinja2.nodes.Tuple` node is created.
         This method could also return a regular expression instead of a tuple
         if no commas where found.
 

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/runtime.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/runtime.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.runtime
+    ambari_jinja2.runtime
     ~~~~~~~~~~~~~~
 
     Runtime helpers.
@@ -10,10 +10,10 @@
 """
 import sys
 from itertools import chain, imap
-from jinja2.nodes import EvalContext, _context_function_types
-from jinja2.utils import Markup, partial, soft_unicode, escape, missing, \
+from ambari_jinja2.nodes import EvalContext, _context_function_types
+from ambari_jinja2.utils import Markup, partial, soft_unicode, escape, missing, \
      concat, internalcode, next, object_type_repr
-from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
+from ambari_jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
      TemplateNotFound
 
 

+ 7 - 7
ambari-common/src/main/python/jinja2/jinja2/sandbox.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/sandbox.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.sandbox
+    ambari_jinja2.sandbox
     ~~~~~~~~~~~~~~
 
     Adds a sandbox layer to Jinja as it was the default behavior in the old
@@ -13,10 +13,10 @@
     :license: BSD.
 """
 import operator
-from jinja2.runtime import Undefined
-from jinja2.environment import Environment
-from jinja2.exceptions import SecurityError
-from jinja2.utils import FunctionType, MethodType, TracebackType, CodeType, \
+from ambari_jinja2.runtime import Undefined
+from ambari_jinja2.environment import Environment
+from ambari_jinja2.exceptions import SecurityError
+from ambari_jinja2.utils import FunctionType, MethodType, TracebackType, CodeType, \
      FrameType, GeneratorType
 
 
@@ -35,7 +35,7 @@ import warnings
 
 # make sure we don't warn in python 2.6 about stuff we don't care about
 warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
-                        module='jinja2.sandbox')
+                        module='ambari_jinja2.sandbox')
 
 from collections import deque
 
@@ -116,7 +116,7 @@ def is_internal_attribute(obj, attr):
     python objects.  This is useful if the environment method
     :meth:`~SandboxedEnvironment.is_safe_attribute` is overriden.
 
-    >>> from jinja2.sandbox import is_internal_attribute
+    >>> from ambari_jinja2.sandbox import is_internal_attribute
     >>> is_internal_attribute(lambda: None, "func_code")
     True
     >>> is_internal_attribute((lambda x:x).func_code, 'co_code')

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/tests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/tests.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.tests
+    ambari_jinja2.tests
     ~~~~~~~~~~~~
 
     Jinja test functions. Used with the "is" operator.
@@ -9,7 +9,7 @@
     :license: BSD, see LICENSE for more details.
 """
 import re
-from jinja2.runtime import Undefined
+from ambari_jinja2.runtime import Undefined
 
 # nose, nothing here to test
 __test__ = False

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/__init__.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/__init__.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite
+    ambari_jinja2.testsuite
     ~~~~~~~~~~~~~~~~
 
     All the unittests of Jinja2.  These tests can be executed by
@@ -15,7 +15,7 @@ import re
 import sys
 import unittest
 from traceback import format_exception
-from jinja2 import loaders
+from ambari_jinja2 import loaders
 
 
 here = os.path.dirname(os.path.abspath(__file__))
@@ -23,7 +23,7 @@ here = os.path.dirname(os.path.abspath(__file__))
 dict_loader = loaders.DictLoader({
     'justdict.html':        'FOO'
 })
-package_loader = loaders.PackageLoader('jinja2.testsuite.res', 'templates')
+package_loader = loaders.PackageLoader('ambari_jinja2.testsuite.res', 'templates')
 filesystem_loader = loaders.FileSystemLoader(here + '/res/templates')
 function_loader = loaders.FunctionLoader({'justfunction.html': 'FOO'}.get)
 choice_loader = loaders.ChoiceLoader([dict_loader, package_loader])
@@ -69,7 +69,7 @@ class JinjaTestCase(unittest.TestCase):
 
 
 def suite():
-    from jinja2.testsuite import ext, filters, tests, core_tags, \
+    from ambari_jinja2.testsuite import ext, filters, tests, core_tags, \
          loader, inheritance, imports, lexnparse, security, api, \
          regression, debug, utils, doctests
     suite = unittest.TestSuite()

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/api.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/api.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.api
+    ambari_jinja2.testsuite.api
     ~~~~~~~~~~~~~~~~~~~~
 
     Tests the public API and related stuff.
@@ -13,12 +13,12 @@ import time
 import tempfile
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment, Undefined, DebugUndefined, \
+from ambari_jinja2 import Environment, Undefined, DebugUndefined, \
      StrictUndefined, UndefinedError, Template, meta, \
      is_undefined, Template, DictLoader
-from jinja2.utils import Cycler
+from ambari_jinja2.utils import Cycler
 
 env = Environment()
 
@@ -26,7 +26,7 @@ env = Environment()
 class ExtendedAPITestCase(JinjaTestCase):
 
     def test_item_and_attribute(self):
-        from jinja2.sandbox import SandboxedEnvironment
+        from ambari_jinja2.sandbox import SandboxedEnvironment
 
         for env in Environment(), SandboxedEnvironment():
             # the |list is necessary for python3

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/core_tags.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/core_tags.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.core_tags
+    ambari_jinja2.testsuite.core_tags
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Test the core tags like for and if.
@@ -11,9 +11,9 @@
 import re
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment, TemplateSyntaxError, UndefinedError, \
+from ambari_jinja2 import Environment, TemplateSyntaxError, UndefinedError, \
      DictLoader
 
 env = Environment()

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/debug.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/debug.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.debug
+    ambari_jinja2.testsuite.debug
     ~~~~~~~~~~~~~~~~~~~~~~
 
     Tests the debug system.
@@ -11,9 +11,9 @@
 import sys
 import unittest
 
-from jinja2.testsuite import JinjaTestCase, filesystem_loader
+from ambari_jinja2.testsuite import JinjaTestCase, filesystem_loader
 
-from jinja2 import Environment, TemplateSyntaxError
+from ambari_jinja2 import Environment, TemplateSyntaxError
 
 env = Environment(loader=filesystem_loader)
 
@@ -41,7 +41,7 @@ ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero
         self.assert_traceback_matches(lambda: env.get_template('syntaxerror.html'), r'''(?sm)
   File ".*?syntaxerror.html", line 4, in (template|<module>)
     \{% endif %\}.*?
-(jinja2\.exceptions\.)?TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'.
+(ambari_jinja2\.exceptions\.)?TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'.
     ''')
 
     def test_regular_syntax_error(self):
@@ -50,7 +50,7 @@ ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero
         self.assert_traceback_matches(test, r'''
   File ".*debug.pyc?", line \d+, in test
     raise TemplateSyntaxError\('wtf', 42\)
-(jinja2\.exceptions\.)?TemplateSyntaxError: wtf
+(ambari_jinja2\.exceptions\.)?TemplateSyntaxError: wtf
   line 42''')
 
 

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/testsuite/doctests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/doctests.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.doctests
+    ambari_jinja2.testsuite.doctests
     ~~~~~~~~~~~~~~~~~~~~~~~~~
 
     The doctests.  Collects all tests we want to test from
@@ -14,7 +14,7 @@ import doctest
 
 
 def suite():
-    from jinja2 import utils, sandbox, runtime, meta, loaders, \
+    from ambari_jinja2 import utils, sandbox, runtime, meta, loaders, \
         ext, environment, bccache, nodes
     suite = unittest.TestSuite()
     suite.addTest(doctest.DocTestSuite(utils))

+ 25 - 25
ambari-common/src/main/python/jinja2/jinja2/testsuite/ext.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/ext.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.ext
+    ambari_jinja2.testsuite.ext
     ~~~~~~~~~~~~~~~~~~~~
 
     Tests for the extensions.
@@ -11,13 +11,13 @@
 import re
 import unittest
 
-from jinja2.testsuite import JinjaTestCase, filesystem_loader
+from ambari_jinja2.testsuite import JinjaTestCase, filesystem_loader
 
-from jinja2 import Environment, DictLoader, contextfunction, nodes
-from jinja2.exceptions import TemplateAssertionError
-from jinja2.ext import Extension
-from jinja2.lexer import Token, count_newlines
-from jinja2.utils import next
+from ambari_jinja2 import Environment, DictLoader, contextfunction, nodes
+from ambari_jinja2.exceptions import TemplateAssertionError
+from ambari_jinja2.ext import Extension
+from ambari_jinja2.lexer import Token, count_newlines
+from ambari_jinja2.utils import next
 
 # 2.x / 3.x
 try:
@@ -91,7 +91,7 @@ def ngettext(context, s, p, n):
 
 i18n_env = Environment(
     loader=DictLoader(i18n_templates),
-    extensions=['jinja2.ext.i18n']
+    extensions=['ambari_jinja2.ext.i18n']
 )
 i18n_env.globals.update({
     '_':            gettext,
@@ -101,7 +101,7 @@ i18n_env.globals.update({
 
 newstyle_i18n_env = Environment(
     loader=DictLoader(newstyle_i18n_templates),
-    extensions=['jinja2.ext.i18n']
+    extensions=['ambari_jinja2.ext.i18n']
 )
 newstyle_i18n_env.install_gettext_callables(gettext, ngettext, newstyle=True)
 
@@ -169,12 +169,12 @@ class ExtensionsTestCase(JinjaTestCase):
 
     def test_extend_late(self):
         env = Environment()
-        env.add_extension('jinja2.ext.autoescape')
+        env.add_extension('ambari_jinja2.ext.autoescape')
         t = env.from_string('{% autoescape true %}{{ "<test>" }}{% endautoescape %}')
         assert t.render() == '&lt;test&gt;'
 
     def test_loop_controls(self):
-        env = Environment(extensions=['jinja2.ext.loopcontrols'])
+        env = Environment(extensions=['ambari_jinja2.ext.loopcontrols'])
 
         tmpl = env.from_string('''
             {%- for item in [1, 2, 3, 4] %}
@@ -191,7 +191,7 @@ class ExtensionsTestCase(JinjaTestCase):
         assert tmpl.render() == '12'
 
     def test_do(self):
-        env = Environment(extensions=['jinja2.ext.do'])
+        env = Environment(extensions=['ambari_jinja2.ext.do'])
         tmpl = env.from_string('''
             {%- set items = [] %}
             {%- for char in "foo" %}
@@ -200,7 +200,7 @@ class ExtensionsTestCase(JinjaTestCase):
         assert tmpl.render() == '0f, 1o, 2o'
 
     def test_with(self):
-        env = Environment(extensions=['jinja2.ext.with_'])
+        env = Environment(extensions=['ambari_jinja2.ext.with_'])
         tmpl = env.from_string('''\
         {% with a=42, b=23 -%}
             {{ a }} = {{ b }}
@@ -271,7 +271,7 @@ class InternationalizationTestCase(JinjaTestCase):
         assert tmpl.render(LANGUAGE='de', user_count=5) == 'Benutzer: 5'
 
     def test_extract(self):
-        from jinja2.ext import babel_extract
+        from ambari_jinja2.ext import babel_extract
         source = BytesIO('''
         {{ gettext('Hello World') }}
         {% trans %}Hello World{% endtrans %}
@@ -284,7 +284,7 @@ class InternationalizationTestCase(JinjaTestCase):
         ]
 
     def test_comment_extract(self):
-        from jinja2.ext import babel_extract
+        from ambari_jinja2.ext import babel_extract
         source = BytesIO('''
         {# trans first #}
         {{ gettext('Hello World') }}
@@ -327,8 +327,8 @@ class NewstyleInternationalizationTestCase(JinjaTestCase):
         assert tmpl.render(LANGUAGE='de', apples=5) == u'5 Äpfel'
 
     def test_autoescape_support(self):
-        env = Environment(extensions=['jinja2.ext.autoescape',
-                                      'jinja2.ext.i18n'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape',
+                                      'ambari_jinja2.ext.i18n'])
         env.install_gettext_callables(lambda x: u'<strong>Wert: %(name)s</strong>',
                                       lambda s, p, n: s, newstyle=True)
         t = env.from_string('{% autoescape ae %}{{ gettext("foo", name='
@@ -372,7 +372,7 @@ class NewstyleInternationalizationTestCase(JinjaTestCase):
 class AutoEscapeTestCase(JinjaTestCase):
 
     def test_scoped_setting(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
         tmpl = env.from_string('''
             {{ "<HelloWorld>" }}
@@ -384,7 +384,7 @@ class AutoEscapeTestCase(JinjaTestCase):
         assert tmpl.render().split() == \
             [u'&lt;HelloWorld&gt;', u'<HelloWorld>', u'&lt;HelloWorld&gt;']
 
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=False)
         tmpl = env.from_string('''
             {{ "<HelloWorld>" }}
@@ -397,7 +397,7 @@ class AutoEscapeTestCase(JinjaTestCase):
             [u'<HelloWorld>', u'&lt;HelloWorld&gt;', u'<HelloWorld>']
 
     def test_nonvolatile(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
         tmpl = env.from_string('{{ {"foo": "<test>"}|xmlattr|escape }}')
         assert tmpl.render() == ' foo="&lt;test&gt;"'
@@ -406,7 +406,7 @@ class AutoEscapeTestCase(JinjaTestCase):
         assert tmpl.render() == ' foo=&#34;&amp;lt;test&amp;gt;&#34;'
 
     def test_volatile(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
         tmpl = env.from_string('{% autoescape foo %}{{ {"foo": "<test>"}'
                                '|xmlattr|escape }}{% endautoescape %}')
@@ -414,13 +414,13 @@ class AutoEscapeTestCase(JinjaTestCase):
         assert tmpl.render(foo=True) == ' foo="&lt;test&gt;"'
 
     def test_scoping(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'])
         tmpl = env.from_string('{% autoescape true %}{% set x = "<x>" %}{{ x }}'
                                '{% endautoescape %}{{ x }}{{ "<y>" }}')
         assert tmpl.render(x=1) == '&lt;x&gt;1<y>'
 
     def test_volatile_scoping(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'])
         tmplsource = '''
         {% autoescape val %}
             {% macro foo(x) %}
@@ -436,11 +436,11 @@ class AutoEscapeTestCase(JinjaTestCase):
 
         # looking at the source we should see <testing> there in raw
         # (and then escaped as well)
-        env = Environment(extensions=['jinja2.ext.autoescape'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'])
         pysource = env.compile(tmplsource, raw=True)
         assert '<testing>\\n' in pysource
 
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
         pysource = env.compile(tmplsource, raw=True)
         assert '&lt;testing&gt;\\n' in pysource

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/filters.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/filters.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.filters
+    ambari_jinja2.testsuite.filters
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
     Tests for the jinja filters.
@@ -9,9 +9,9 @@
     :license: BSD, see LICENSE for more details.
 """
 import unittest
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Markup, Environment
+from ambari_jinja2 import Markup, Environment
 
 env = Environment()
 

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/imports.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/imports.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.imports
+    ambari_jinja2.testsuite.imports
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
     Tests the import features (with includes).
@@ -13,10 +13,10 @@ import time
 import tempfile
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment, DictLoader
-from jinja2.exceptions import TemplateNotFound, TemplatesNotFound
+from ambari_jinja2 import Environment, DictLoader
+from ambari_jinja2.exceptions import TemplateNotFound, TemplatesNotFound
 
 
 test_env = Environment(loader=DictLoader(dict(

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/inheritance.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/inheritance.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.inheritance
+    ambari_jinja2.testsuite.inheritance
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Tests the template inheritance feature.
@@ -13,10 +13,10 @@ import time
 import tempfile
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment, DictLoader
-from jinja2.exceptions import TemplateSyntaxError
+from ambari_jinja2 import Environment, DictLoader
+from ambari_jinja2.exceptions import TemplateSyntaxError
 
 
 LAYOUTTEMPLATE = '''\

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/lexnparse.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/lexnparse.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.lexnparse
+    ambari_jinja2.testsuite.lexnparse
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     All the unittests regarding lexing, parsing and syntax.
@@ -14,9 +14,9 @@ import time
 import tempfile
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment, Template, TemplateSyntaxError, \
+from ambari_jinja2 import Environment, Template, TemplateSyntaxError, \
      UndefinedError, nodes
 
 env = Environment()
@@ -70,7 +70,7 @@ class LexerTestCase(JinjaTestCase):
         assert tmpl.render() == pformat('foo') + '|' + pformat(u'bär')
 
     def test_operators(self):
-        from jinja2.lexer import operators
+        from ambari_jinja2.lexer import operators
         for test, expect in operators.iteritems():
             if test in '([{}])':
                 continue

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/loader.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/loader.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.loader
+    ambari_jinja2.testsuite.loader
     ~~~~~~~~~~~~~~~~~~~~~~~
 
     Test the loaders.
@@ -15,13 +15,13 @@ import tempfile
 import shutil
 import unittest
 
-from jinja2.testsuite import JinjaTestCase, dict_loader, \
+from ambari_jinja2.testsuite import JinjaTestCase, dict_loader, \
      package_loader, filesystem_loader, function_loader, \
      choice_loader, prefix_loader
 
-from jinja2 import Environment, loaders
-from jinja2.loaders import split_template_path
-from jinja2.exceptions import TemplateNotFound
+from ambari_jinja2 import Environment, loaders
+from ambari_jinja2.loaders import split_template_path
+from ambari_jinja2.exceptions import TemplateNotFound
 
 
 class LoaderTestCase(JinjaTestCase):

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/regression.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/regression.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.regression
+    ambari_jinja2.testsuite.regression
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Tests corner cases and bugs.
@@ -13,9 +13,9 @@ import time
 import tempfile
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Template, Environment, DictLoader, TemplateSyntaxError, \
+from ambari_jinja2 import Template, Environment, DictLoader, TemplateSyntaxError, \
      TemplateNotFound, PrefixLoader
 
 env = Environment()

+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/broken.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/broken.html


+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/foo/test.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/foo/test.html


+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/syntaxerror.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/syntaxerror.html


+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/test.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/test.html


+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/testsuite/security.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/security.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.security
+    ambari_jinja2.testsuite.security
     ~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Checks the sandbox and other security features.
@@ -13,13 +13,13 @@ import time
 import tempfile
 import unittest
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment
-from jinja2.sandbox import SandboxedEnvironment, \
+from ambari_jinja2 import Environment
+from ambari_jinja2.sandbox import SandboxedEnvironment, \
      ImmutableSandboxedEnvironment, unsafe
-from jinja2 import Markup, escape
-from jinja2.exceptions import SecurityError, TemplateSyntaxError
+from ambari_jinja2 import Markup, escape
+from ambari_jinja2.exceptions import SecurityError, TemplateSyntaxError
 
 
 class PrivateStuff(object):

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/tests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/tests.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.tests
+    ambari_jinja2.testsuite.tests
     ~~~~~~~~~~~~~~~~~~~~~~
 
     Who tests the tests?
@@ -9,9 +9,9 @@
     :license: BSD, see LICENSE for more details.
 """
 import unittest
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Markup, Environment
+from ambari_jinja2 import Markup, Environment
 
 env = Environment()
 

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/utils.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/utils.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.testsuite.utils
+    ambari_jinja2.testsuite.utils
     ~~~~~~~~~~~~~~~~~~~~~~
 
     Tests utilities jinja uses.
@@ -14,11 +14,11 @@ import unittest
 
 import pickle
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
-from jinja2 import Environment, Undefined, DebugUndefined, \
+from ambari_jinja2 import Environment, Undefined, DebugUndefined, \
      StrictUndefined, UndefinedError, Template, meta
-from jinja2.utils import LRUCache, escape, object_type_repr
+from ambari_jinja2.utils import LRUCache, escape, object_type_repr
 
 
 class LRUCacheTestCase(JinjaTestCase):
@@ -54,7 +54,7 @@ class HelpersTestCase(JinjaTestCase):
         self.assert_equal(object_type_repr(42), 'int object')
         self.assert_equal(object_type_repr([]), 'list object')
         self.assert_equal(object_type_repr(X()),
-                         'jinja2.testsuite.utils.X object')
+                         'ambari_jinja2.testsuite.utils.X object')
         self.assert_equal(object_type_repr(None), 'None')
         self.assert_equal(object_type_repr(Ellipsis), 'Ellipsis')
 

+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/utils.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/utils.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.utils
+    ambari_jinja2.utils
     ~~~~~~~~~~~~
 
     Utility functions.
@@ -168,7 +168,7 @@ def is_undefined(obj):
                 return default
             return var
     """
-    from jinja2.runtime import Undefined
+    from ambari_jinja2.runtime import Undefined
     return isinstance(obj, Undefined)
 
 
@@ -184,8 +184,8 @@ def clear_caches():
     the time.  Normally you don't have to care about that but if you are
     messuring memory consumption you may want to clean the caches.
     """
-    from jinja2.environment import _spontaneous_environments
-    from jinja2.lexer import _lexer_cache
+    from ambari_jinja2.environment import _spontaneous_environments
+    from ambari_jinja2.lexer import _lexer_cache
     _spontaneous_environments.clear()
     _lexer_cache.clear()
 
@@ -302,7 +302,7 @@ def urlize(text, trim_url_limit=None, nofollow=False):
 
 def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
     """Generate some lorem impsum for the template."""
-    from jinja2.constants import LOREM_IPSUM_WORDS
+    from ambari_jinja2.constants import LOREM_IPSUM_WORDS
     from random import choice, randrange
     words = LOREM_IPSUM_WORDS.split()
     result = []
@@ -584,7 +584,7 @@ class Joiner(object):
 try:
     from markupsafe import Markup, escape, soft_unicode
 except ImportError:
-    from jinja2._markupsafe import Markup, escape, soft_unicode
+    from ambari_jinja2._markupsafe import Markup, escape, soft_unicode
 
 
 # partials

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/visitor.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/visitor.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-    jinja2.visitor
+    ambari_jinja2.visitor
     ~~~~~~~~~~~~~~
 
     This module implements a visitor for the nodes.
@@ -8,7 +8,7 @@
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD.
 """
-from jinja2.nodes import Node
+from ambari_jinja2.nodes import Node
 
 
 class NodeVisitor(object):

+ 2 - 2
ambari-common/src/main/python/jinja2/artwork/jinjalogo.svg → ambari-common/src/main/python/ambari_jinja2/artwork/jinjalogo.svg

@@ -15,9 +15,9 @@
    sodipodi:version="0.32"
    inkscape:version="0.45.1"
    version="1.0"
-   sodipodi:docbase="/Users/mitsuhiko/Development/jinja2/artwork"
+   sodipodi:docbase="/Users/mitsuhiko/Development/ambari_jinja2/artwork"
    sodipodi:docname="jinjalogo.svg"
-   inkscape:export-filename="/Users/mitsuhiko/Development/jinja2/docs/_static/jinjabanner.png"
+   inkscape:export-filename="/Users/mitsuhiko/Development/ambari_jinja2/docs/_static/jinjabanner.png"
    inkscape:export-xdpi="60"
    inkscape:export-ydpi="60"
    inkscape:output_extension="org.inkscape.output.svg.inkscape">

+ 0 - 0
ambari-common/src/main/python/jinja2/custom_fixers/fix_alt_unicode.py → ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_alt_unicode.py


+ 0 - 0
ambari-common/src/main/python/jinja2/custom_fixers/fix_broken_reraising.py → ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_broken_reraising.py


+ 0 - 0
ambari-common/src/main/python/jinja2/custom_fixers/fix_xrange2.py → ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_xrange2.py


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/Makefile → ambari-common/src/main/python/ambari_jinja2/docs/Makefile


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_static/jinja.js → ambari-common/src/main/python/ambari_jinja2/docs/_static/jinja.js


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_static/print.css → ambari-common/src/main/python/ambari_jinja2/docs/_static/print.css


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_static/style.css → ambari-common/src/main/python/ambari_jinja2/docs/_static/style.css


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/genindex.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/genindex.html


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/layout.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/layout.html


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/opensearch.xml → ambari-common/src/main/python/ambari_jinja2/docs/_templates/opensearch.xml


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/page.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/page.html


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/search.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/search.html


+ 40 - 40
ambari-common/src/main/python/jinja2/docs/api.rst → ambari-common/src/main/python/ambari_jinja2/docs/api.rst

@@ -1,7 +1,7 @@
 API
 ===
 
-.. module:: jinja2
+.. module:: ambari_jinja2
     :synopsis: public Jinja2 API
 
 This document describes the API to Jinja2 and not the template language.  It
@@ -26,7 +26,7 @@ are in use.
 The simplest way to configure Jinja2 to load templates for your application
 looks roughly like this::
 
-    from jinja2 import Environment, PackageLoader
+    from ambari_jinja2 import Environment, PackageLoader
     env = Environment(loader=PackageLoader('yourapplication', 'templates'))
 
 This will create a template environment with the default settings and a
@@ -130,7 +130,7 @@ useful if you want to dig deeper into Jinja2 or :ref:`develop extensions
 
         If the environment is sandboxed this attribute is `True`.  For the
         sandbox mode have a look at the documentation for the
-        :class:`~jinja2.sandbox.SandboxedEnvironment`.
+        :class:`~ambari_jinja2.sandbox.SandboxedEnvironment`.
 
     .. attribute:: filters
 
@@ -216,7 +216,7 @@ useful if you want to dig deeper into Jinja2 or :ref:`develop extensions
     .. automethod:: stream([context])
 
 
-.. autoclass:: jinja2.environment.TemplateStream()
+.. autoclass:: ambari_jinja2.environment.TemplateStream()
     :members: disable_buffering, enable_buffering, dump
 
 
@@ -242,7 +242,7 @@ for all other extensions::
 
     env = Environment(autoescape=guess_autoescape,
                       loader=PackageLoader('mypackage'),
-                      extensions=['jinja2.ext.autoescape'])
+                      extensions=['ambari_jinja2.ext.autoescape'])
 
 When implementing a guessing autoescape function, make sure you also
 accept `None` as valid template name.  This will be passed when generating
@@ -283,7 +283,7 @@ others fail.
 The closest to regular Python behavior is the `StrictUndefined` which
 disallows all operations beside testing if it's an undefined object.
 
-.. autoclass:: jinja2.Undefined()
+.. autoclass:: ambari_jinja2.Undefined()
 
     .. attribute:: _undefined_hint
 
@@ -311,9 +311,9 @@ disallows all operations beside testing if it's an undefined object.
         :attr:`_undefined_exception` with an error message generated
         from the undefined hints stored on the undefined object.
 
-.. autoclass:: jinja2.DebugUndefined()
+.. autoclass:: ambari_jinja2.DebugUndefined()
 
-.. autoclass:: jinja2.StrictUndefined()
+.. autoclass:: ambari_jinja2.StrictUndefined()
 
 Undefined objects are created by calling :attr:`undefined`.
 
@@ -345,7 +345,7 @@ Undefined objects are created by calling :attr:`undefined`.
 The Context
 -----------
 
-.. autoclass:: jinja2.runtime.Context()
+.. autoclass:: ambari_jinja2.runtime.Context()
     :members: resolve, get_exported, get_all
 
     .. attribute:: parent
@@ -389,7 +389,7 @@ The Context
 
         The current :ref:`eval-context`.
 
-    .. automethod:: jinja2.runtime.Context.call(callable, \*args, \**kwargs)
+    .. automethod:: ambari_jinja2.runtime.Context.call(callable, \*args, \**kwargs)
 
 
 .. admonition:: Implementation
@@ -416,22 +416,22 @@ size by default and templates are automatically reloaded.
 All loaders are subclasses of :class:`BaseLoader`.  If you want to create your
 own loader, subclass :class:`BaseLoader` and override `get_source`.
 
-.. autoclass:: jinja2.BaseLoader
+.. autoclass:: ambari_jinja2.BaseLoader
     :members: get_source, load
 
 Here a list of the builtin loaders Jinja2 provides:
 
-.. autoclass:: jinja2.FileSystemLoader
+.. autoclass:: ambari_jinja2.FileSystemLoader
 
-.. autoclass:: jinja2.PackageLoader
+.. autoclass:: ambari_jinja2.PackageLoader
 
-.. autoclass:: jinja2.DictLoader
+.. autoclass:: ambari_jinja2.DictLoader
 
-.. autoclass:: jinja2.FunctionLoader
+.. autoclass:: ambari_jinja2.FunctionLoader
 
-.. autoclass:: jinja2.PrefixLoader
+.. autoclass:: ambari_jinja2.PrefixLoader
 
-.. autoclass:: jinja2.ChoiceLoader
+.. autoclass:: ambari_jinja2.ChoiceLoader
 
 
 .. _bytecode-cache:
@@ -449,10 +449,10 @@ the application.
 
 To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.
 
-.. autoclass:: jinja2.BytecodeCache
+.. autoclass:: ambari_jinja2.BytecodeCache
     :members: load_bytecode, dump_bytecode, clear
 
-.. autoclass:: jinja2.bccache.Bucket
+.. autoclass:: ambari_jinja2.bccache.Bucket
     :members: write_bytecode, load_bytecode, bytecode_from_string,
               bytecode_to_string, reset
 
@@ -471,9 +471,9 @@ To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.
 
 Builtin bytecode caches:
 
-.. autoclass:: jinja2.FileSystemBytecodeCache
+.. autoclass:: ambari_jinja2.FileSystemBytecodeCache
 
-.. autoclass:: jinja2.MemcachedBytecodeCache
+.. autoclass:: ambari_jinja2.MemcachedBytecodeCache
 
 
 Utilities
@@ -482,17 +482,17 @@ Utilities
 These helper functions and classes are useful if you add custom filters or
 functions to a Jinja2 environment.
 
-.. autofunction:: jinja2.environmentfilter
+.. autofunction:: ambari_jinja2.environmentfilter
 
-.. autofunction:: jinja2.contextfilter
+.. autofunction:: ambari_jinja2.contextfilter
 
-.. autofunction:: jinja2.evalcontextfilter
+.. autofunction:: ambari_jinja2.evalcontextfilter
 
-.. autofunction:: jinja2.environmentfunction
+.. autofunction:: ambari_jinja2.environmentfunction
 
-.. autofunction:: jinja2.contextfunction
+.. autofunction:: ambari_jinja2.contextfunction
 
-.. autofunction:: jinja2.evalcontextfunction
+.. autofunction:: ambari_jinja2.evalcontextfunction
 
 .. function:: escape(s)
 
@@ -503,11 +503,11 @@ functions to a Jinja2 environment.
 
     The return value is a :class:`Markup` string.
 
-.. autofunction:: jinja2.clear_caches
+.. autofunction:: ambari_jinja2.clear_caches
 
-.. autofunction:: jinja2.is_undefined
+.. autofunction:: ambari_jinja2.is_undefined
 
-.. autoclass:: jinja2.Markup([string])
+.. autoclass:: ambari_jinja2.Markup([string])
     :members: escape, unescape, striptags
 
 .. admonition:: Note
@@ -520,15 +520,15 @@ functions to a Jinja2 environment.
 Exceptions
 ----------
 
-.. autoexception:: jinja2.TemplateError
+.. autoexception:: ambari_jinja2.TemplateError
 
-.. autoexception:: jinja2.UndefinedError
+.. autoexception:: ambari_jinja2.UndefinedError
 
-.. autoexception:: jinja2.TemplateNotFound
+.. autoexception:: ambari_jinja2.TemplateNotFound
 
-.. autoexception:: jinja2.TemplatesNotFound
+.. autoexception:: ambari_jinja2.TemplatesNotFound
 
-.. autoexception:: jinja2.TemplateSyntaxError
+.. autoexception:: ambari_jinja2.TemplateSyntaxError
 
     .. attribute:: message
 
@@ -551,7 +551,7 @@ Exceptions
     unicode strings is that Python 2.x is not using unicode for exceptions
     and tracebacks as well as the compiler.  This will change with Python 3.
 
-.. autoexception:: jinja2.TemplateAssertionError
+.. autoexception:: ambari_jinja2.TemplateAssertionError
 
 
 .. _writing-filters:
@@ -593,7 +593,7 @@ paragraphs and marks the return value as safe HTML string if autoescaping is
 enabled::
 
     import re
-    from jinja2 import environmentfilter, Markup, escape
+    from ambari_jinja2 import environmentfilter, Markup, escape
 
     _paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')
 
@@ -659,7 +659,7 @@ must only happen with a :class:`nodes.EvalContextModifier` and
 :class:`nodes.ScopedEvalContextModifier` from an extension, not on the
 eval context object itself.
 
-.. autoclass:: jinja2.nodes.EvalContext
+.. autoclass:: ambari_jinja2.nodes.EvalContext
 
    .. attribute:: autoescape
 
@@ -782,6 +782,6 @@ could help applications to implement more advanced template concepts.  All
 the functions of the meta API operate on an abstract syntax tree as
 returned by the :meth:`Environment.parse` method.
 
-.. autofunction:: jinja2.meta.find_undeclared_variables
+.. autofunction:: ambari_jinja2.meta.find_undeclared_variables
 
-.. autofunction:: jinja2.meta.find_referenced_templates
+.. autofunction:: ambari_jinja2.meta.find_referenced_templates

+ 2 - 2
ambari-common/src/main/python/jinja2/docs/cache_extension.py → ambari-common/src/main/python/ambari_jinja2/docs/cache_extension.py

@@ -1,5 +1,5 @@
-from jinja2 import nodes
-from jinja2.ext import Extension
+from ambari_jinja2 import nodes
+from ambari_jinja2.ext import Extension
 
 
 class FragmentCacheExtension(Extension):

+ 3 - 0
ambari-common/src/main/python/ambari_jinja2/docs/changelog.rst

@@ -0,0 +1,3 @@
+.. module:: ambari_jinja2
+
+.. include:: ../CHANGES

+ 0 - 0
ambari-common/src/main/python/jinja2/docs/conf.py → ambari-common/src/main/python/ambari_jinja2/docs/conf.py


+ 23 - 23
ambari-common/src/main/python/jinja2/docs/extensions.rst → ambari-common/src/main/python/ambari_jinja2/docs/extensions.rst

@@ -17,7 +17,7 @@ extension pass a list of extension classes or import paths to the
 `environment` parameter of the :class:`Environment` constructor.  The following
 example creates a Jinja2 environment with the i18n extension loaded::
 
-    jinja_env = Environment(extensions=['jinja2.ext.i18n'])
+    jinja_env = Environment(extensions=['ambari_jinja2.ext.i18n'])
 
 
 .. _i18n-extension:
@@ -25,7 +25,7 @@ example creates a Jinja2 environment with the i18n extension loaded::
 i18n Extension
 --------------
 
-**Import name:** `jinja2.ext.i18n`
+**Import name:** `ambari_jinja2.ext.i18n`
 
 Jinja2 currently comes with one extension, the i18n extension.  It can be
 used in combination with `gettext`_ or `babel`_.  If the i18n extension is
@@ -43,7 +43,7 @@ Environment Methods
 After enabling of the extension the environment provides the following
 additional methods:
 
-.. method:: jinja2.Environment.install_gettext_translations(translations, newstyle=False)
+.. method:: ambari_jinja2.Environment.install_gettext_translations(translations, newstyle=False)
 
     Installs a translation globally for that environment.  The tranlations
     object provided must implement at least `ugettext` and `ungettext`.
@@ -52,7 +52,7 @@ additional methods:
 
     .. versionchanged:: 2.5 newstyle gettext added
 
-.. method:: jinja2.Environment.install_null_translations(newstyle=False)
+.. method:: ambari_jinja2.Environment.install_null_translations(newstyle=False)
 
     Install dummy gettext functions.  This is useful if you want to prepare
     the application for internationalization but don't want to implement the
@@ -60,7 +60,7 @@ additional methods:
 
     .. versionchanged:: 2.5 newstyle gettext added
 
-.. method:: jinja2.Environment.install_gettext_callables(gettext, ngettext, newstyle=False)
+.. method:: ambari_jinja2.Environment.install_gettext_callables(gettext, ngettext, newstyle=False)
 
     Installs the given `gettext` and `ngettext` callables into the
     environment as globals.  They are supposed to behave exactly like the
@@ -72,11 +72,11 @@ additional methods:
 
     .. versionadded:: 2.5
 
-.. method:: jinja2.Environment.uninstall_gettext_translations()
+.. method:: ambari_jinja2.Environment.uninstall_gettext_translations()
 
     Uninstall the translations again.
 
-.. method:: jinja2.Environment.extract_translations(source)
+.. method:: ambari_jinja2.Environment.extract_translations(source)
 
     Extract localizable strings from the given template node or source.
 
@@ -98,7 +98,7 @@ installed for a French community) may load the translations once and add the
 translation methods to the environment at environment generation time::
 
     translations = get_gettext_translations()
-    env = Environment(extensions=['jinja2.ext.i18n'])
+    env = Environment(extensions=['ambari_jinja2.ext.i18n'])
     env.install_gettext_translations(translations)
 
 The `get_gettext_translations` function would return the translator for the
@@ -160,7 +160,7 @@ templates are experiencing over time when using autoescaping.
 Expression Statement
 --------------------
 
-**Import name:** `jinja2.ext.do`
+**Import name:** `ambari_jinja2.ext.do`
 
 The "do" aka expression-statement extension adds a simple `do` tag to the
 template engine that works like a variable expression but ignores the
@@ -171,7 +171,7 @@ return value.
 Loop Controls
 -------------
 
-**Import name:** `jinja2.ext.loopcontrols`
+**Import name:** `ambari_jinja2.ext.loopcontrols`
 
 This extension adds support for `break` and `continue` in loops.  After
 enabling Jinja2 provides those two keywords which work exactly like in
@@ -182,7 +182,7 @@ Python.
 With Statement
 --------------
 
-**Import name:** `jinja2.ext.with_`
+**Import name:** `ambari_jinja2.ext.with_`
 
 .. versionadded:: 2.3
 
@@ -196,7 +196,7 @@ standard `set` statement directly within.
 Autoescape Extension
 --------------------
 
-**Import name:** `jinja2.ext.autoescape`
+**Import name:** `ambari_jinja2.ext.autoescape`
 
 .. versionadded:: 2.4
 
@@ -211,7 +211,7 @@ deactivated.  The setting overriding is scoped.
 Writing Extensions
 ------------------
 
-.. module:: jinja2.ext
+.. module:: ambari_jinja2.ext
 
 By writing extensions you can add custom tags to Jinja2.  This is a non trival
 task and usually not needed as the default tags and expressions cover all
@@ -236,7 +236,7 @@ The following example implements a `cache` tag for Jinja2 by using the
 
 And here is how you use it in an environment::
 
-    from jinja2 import Environment
+    from ambari_jinja2 import Environment
     from werkzeug.contrib.cache import SimpleCache
 
     env = Environment(extensions=[FragmentCacheExtension])
@@ -258,7 +258,7 @@ following example caches a sidebar for 300 seconds:
 Extension API
 ~~~~~~~~~~~~~
 
-Extensions always have to extend the :class:`jinja2.ext.Extension` class:
+Extensions always have to extend the :class:`ambari_jinja2.ext.Extension` class:
 
 .. autoclass:: Extension
     :members: preprocess, filter_stream, parse, attr, call_method
@@ -280,7 +280,7 @@ The parser passed to :meth:`Extension.parse` provides ways to parse
 expressions of different types.  The following methods may be used by
 extensions:
 
-.. autoclass:: jinja2.parser.Parser
+.. autoclass:: ambari_jinja2.parser.Parser
     :members: parse_expression, parse_tuple, parse_assign_target,
               parse_statements, free_identifier, fail
 
@@ -297,16 +297,16 @@ extensions:
 
     .. attribute:: stream
 
-        The current :class:`~jinja2.lexer.TokenStream`
+        The current :class:`~ambari_jinja2.lexer.TokenStream`
 
-.. autoclass:: jinja2.lexer.TokenStream
+.. autoclass:: ambari_jinja2.lexer.TokenStream
    :members: push, look, eos, skip, next, next_if, skip_if, expect
 
    .. attribute:: current
 
-        The current :class:`~jinja2.lexer.Token`.
+        The current :class:`~ambari_jinja2.lexer.Token`.
 
-.. autoclass:: jinja2.lexer.Token
+.. autoclass:: ambari_jinja2.lexer.Token
     :members: test, test_any
 
     .. attribute:: lineno
@@ -325,7 +325,7 @@ extensions:
 There is also a utility function in the lexer module that can count newline
 characters in strings:
 
-.. autofunction:: jinja2.lexer.count_newlines
+.. autofunction:: ambari_jinja2.lexer.count_newlines
 
 AST
 ~~~
@@ -338,9 +338,9 @@ execute custom Python code.
 The list below describes all nodes that are currently available.  The AST may
 change between Jinja2 versions but will stay backwards compatible.
 
-For more information have a look at the repr of :meth:`jinja2.Environment.parse`.
+For more information have a look at the repr of :meth:`ambari_jinja2.Environment.parse`.
 
-.. module:: jinja2.nodes
+.. module:: ambari_jinja2.nodes
 
 .. jinjanodes::
 

+ 0 - 0
ambari-common/src/main/python/jinja2/docs/faq.rst → ambari-common/src/main/python/ambari_jinja2/docs/faq.rst


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/index.rst → ambari-common/src/main/python/ambari_jinja2/docs/index.rst


+ 4 - 4
ambari-common/src/main/python/jinja2/docs/integration.rst → ambari-common/src/main/python/ambari_jinja2/docs/integration.rst

@@ -11,7 +11,7 @@ Babel Integration
 -----------------
 
 Jinja provides support for extracting gettext messages from templates via a
-`Babel`_ extractor entry point called `jinja2.ext.babel_extract`.  The Babel
+`Babel`_ extractor entry point called `ambari_jinja2.ext.babel_extract`.  The Babel
 support is implemented as part of the :ref:`i18n-extension` extension.
 
 Gettext messages extracted from both `trans` tags and code expressions.
@@ -21,7 +21,7 @@ in its Babel extraction method `mapping file`_:
 
 .. sourcecode:: ini
 
-    [jinja2: **/templates/**.html]
+    [ambari_jinja2: **/templates/**.html]
     encoding = utf-8
 
 The syntax related options of the :class:`Environment` are also available as
@@ -30,7 +30,7 @@ that templates use ``%`` as `line_statement_prefix` you can use this code:
 
 .. sourcecode:: ini
 
-    [jinja2: **/templates/**.html]
+    [ambari_jinja2: **/templates/**.html]
     encoding = utf-8
     line_statement_prefix = %
 
@@ -49,7 +49,7 @@ Pylons powered application.
 The template engine is configured in `config/environment.py`.  The configuration
 for Jinja2 looks something like that::
 
-    from jinja2 import Environment, PackageLoader
+    from ambari_jinja2 import Environment, PackageLoader
     config['pylons.app_globals'].jinja_env = Environment(
         loader=PackageLoader('yourapplication', 'templates')
     )

+ 8 - 8
ambari-common/src/main/python/jinja2/docs/intro.rst → ambari-common/src/main/python/ambari_jinja2/docs/intro.rst

@@ -80,9 +80,9 @@ Installing the development version
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 1.  Install `git`_
-2.  ``git clone git://github.com/mitsuhiko/jinja2.git``
-3.  ``cd jinja2``
-4.  ``ln -s jinja2 /usr/lib/python2.X/site-packages``
+2.  ``git clone git://github.com/mitsuhiko/ambari_jinja2.git``
+3.  ``cd ambari_jinja2``
+4.  ``ln -s ambari_jinja2 /usr/lib/python2.X/site-packages``
 
 As an alternative to steps 4 you can also do ``python setup.py develop``
 which will install the package via distribute in development mode.  This also
@@ -132,17 +132,17 @@ This section gives you a brief introduction to the Python API for Jinja2
 templates.
 
 The most basic way to create a template and render it is through
-:class:`~jinja2.Template`.  This however is not the recommended way to
+:class:`~ambari_jinja2.Template`.  This however is not the recommended way to
 work with it if your templates are not loaded from strings but the file
 system or another data source:
 
->>> from jinja2 import Template
+>>> from ambari_jinja2 import Template
 >>> template = Template('Hello {{ name }}!')
 >>> template.render(name='John Doe')
 u'Hello John Doe!'
 
-By creating an instance of :class:`~jinja2.Template` you get back a new template
-object that provides a method called :meth:`~jinja2.Template.render` which when
+By creating an instance of :class:`~ambari_jinja2.Template` you get back a new template
+object that provides a method called :meth:`~ambari_jinja2.Template.render` which when
 called with a dict or keyword arguments expands the template.  The dict
 or keywords arguments passed to the template are the so-called "context"
 of the template.
@@ -165,4 +165,4 @@ in mind, you will have to adapt the shown code examples to Python 3 syntax
 for yourself.
 
 
-.. _Jinja bug tracker: http://github.com/mitsuhiko/jinja2/issues
+.. _Jinja bug tracker: http://github.com/mitsuhiko/ambari_jinja2/issues

+ 4 - 4
ambari-common/src/main/python/jinja2/docs/jinjaext.py → ambari-common/src/main/python/ambari_jinja2/docs/jinjaext.py

@@ -11,7 +11,7 @@
 import os
 import re
 import inspect
-import jinja2
+import ambari_jinja2
 from itertools import islice
 from types import BuiltinFunctionType
 from docutils import nodes
@@ -21,7 +21,7 @@ from sphinx.application import TemplateBridge
 from pygments.style import Style
 from pygments.token import Keyword, Name, Comment, String, Error, \
      Number, Operator, Generic
-from jinja2 import Environment, FileSystemLoader
+from ambari_jinja2 import Environment, FileSystemLoader
 
 
 def parse_rst(state, content_offset, doc):
@@ -129,14 +129,14 @@ def dump_functions(mapping):
     return directive
 
 
-from jinja2.defaults import DEFAULT_FILTERS, DEFAULT_TESTS
+from ambari_jinja2.defaults import DEFAULT_FILTERS, DEFAULT_TESTS
 jinja_filters = dump_functions(DEFAULT_FILTERS)
 jinja_tests = dump_functions(DEFAULT_TESTS)
 
 
 def jinja_nodes(dirname, arguments, options, content, lineno,
                 content_offset, block_text, state, state_machine):
-    from jinja2.nodes import Node
+    from ambari_jinja2.nodes import Node
     doc = ViewList()
     def walk(node, indent):
         p = ' ' * indent

+ 1 - 1
ambari-common/src/main/python/jinja2/docs/sandbox.rst → ambari-common/src/main/python/ambari_jinja2/docs/sandbox.rst

@@ -15,7 +15,7 @@ Traceback (most recent call last):
 SecurityError: access to attribute 'func_code' of 'function' object is unsafe.
 
 
-.. module:: jinja2.sandbox
+.. module:: ambari_jinja2.sandbox
 
 .. autoclass:: SandboxedEnvironment([options])
     :members: is_safe_attribute, is_safe_callable

+ 0 - 0
ambari-common/src/main/python/jinja2/docs/switching.rst → ambari-common/src/main/python/ambari_jinja2/docs/switching.rst


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/templates.rst → ambari-common/src/main/python/ambari_jinja2/docs/templates.rst


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/tricks.rst → ambari-common/src/main/python/ambari_jinja2/docs/tricks.rst


+ 1 - 1
ambari-common/src/main/python/jinja2/examples/basic/cycle.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/cycle.py

@@ -1,4 +1,4 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 
 env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}")

+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/debugger.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/debugger.py

@@ -1,5 +1,5 @@
-from jinja2 import Environment
-from jinja2.loaders import FileSystemLoader
+from ambari_jinja2 import Environment
+from ambari_jinja2.loaders import FileSystemLoader
 
 env = Environment(loader=FileSystemLoader('templates'))
 

+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/inheritance.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/inheritance.py

@@ -1,5 +1,5 @@
-from jinja2 import Environment
-from jinja2.loaders import DictLoader
+from ambari_jinja2 import Environment
+from ambari_jinja2.loaders import DictLoader
 
 
 env = Environment(loader=DictLoader({

+ 0 - 0
ambari-common/src/main/python/jinja2/examples/basic/templates/broken.html → ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/broken.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/basic/templates/subbroken.html → ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/subbroken.html


+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/test.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/test.py

@@ -1,5 +1,5 @@
-from jinja2 import Environment
-from jinja2.loaders import DictLoader
+from ambari_jinja2 import Environment
+from ambari_jinja2.loaders import DictLoader
 
 env = Environment(loader=DictLoader({
 'child.html': u'''\

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/basic/test_filter_and_linestatements.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/test_filter_and_linestatements.py

@@ -1,4 +1,4 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 
 env = Environment(line_statement_prefix='%', variable_start_string="${", variable_end_string="}")

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/basic/test_loop_filter.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/test_loop_filter.py

@@ -1,4 +1,4 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 tmpl = Environment().from_string("""\
 <ul>

+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/translate.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/translate.py

@@ -1,6 +1,6 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
-print Environment(extensions=['jinja2.i18n.TransExtension']).from_string("""\
+print Environment(extensions=['ambari_jinja2.i18n.TransExtension']).from_string("""\
 {% trans %}Hello {{ user }}!{% endtrans %}
 {% trans count=users|count %}{{ count }} user{% pluralize %}{{ count }} users{% endtrans %}
 """).render(user="someone")

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/bench.py → ambari-common/src/main/python/ambari_jinja2/examples/bench.py

@@ -6,7 +6,7 @@
 import sys
 import cgi
 from timeit import Timer
-from jinja2 import Environment as JinjaEnvironment
+from ambari_jinja2 import Environment as JinjaEnvironment
 
 context = {
     'page_title': 'mitsuhiko\'s benchmark',

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/profile.py → ambari-common/src/main/python/ambari_jinja2/examples/profile.py

@@ -3,7 +3,7 @@ try:
 except ImportError:
     from profile import Profile
 from pstats import Stats
-from jinja2 import Environment as JinjaEnvironment
+from ambari_jinja2 import Environment as JinjaEnvironment
 
 context = {
     'page_title': 'mitsuhiko\'s benchmark',

+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/django/_form.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_form.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/django/_input_field.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_input_field.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/django/_textarea.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_textarea.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/django/index.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/index.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/django/layout.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/layout.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/djangoext.py → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/djangoext.py


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/genshi/helpers.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/genshi/helpers.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/genshi/index.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/genshi/index.html


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác