"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/dev_guide/pyModules.rst" between
cheetah3-3.1.0.tar.gz and cheetah3-3.2.0.tar.gz

About: Cheetah3 is a template engine and code generation tool for e.g. for Web development or Java, SQL, LaTeX, form email ... (written in Python).

pyModules.rst  (cheetah3-3.1.0):pyModules.rst  (cheetah3-3.2.0)
.py Template Modules .py Template Modules
==================== ====================
(pyModules)
This chapter examines the structure of a .py template module. The This chapter examines the structure of a .py template module. The
following few chapters will then show how each placeholder and following few chapters will then show how each placeholder and
directive affects the generated Python code. directive affects the generated Python code.
An example An example
---------- ----------
(pyModules.example)
Our first template follows a long noble tradition in computer Our first template follows a long noble tradition in computer
tutorials. It produces a familiar, friendly greeting. Here's the tutorials. It produces a familiar, friendly greeting. Here's the
template: template:
:: ::
Hello, world! Hello, world!
... the output: ... the output:
skipping to change at line 168 skipping to change at line 164
fit the page width. The continuation lines don't have line numbers, fit the page width. The continuation lines don't have line numbers,
and I added indentation, backslashes and '#' as necessary to make and I added indentation, backslashes and '#' as necessary to make
the result a valid Python program.) the result a valid Python program.)
The examples were generated from CVS versions of Cheetah between The examples were generated from CVS versions of Cheetah between
0.9.12 and 0.9.14. 0.9.12 and 0.9.14.
A walk through the example A walk through the example
-------------------------- --------------------------
(pyModules.walk)
Lines 20-24 are the Cheetah-specific imports. Line 33 introduces Lines 20-24 are the Cheetah-specific imports. Line 33 introduces
our generated class, {x}, a subclass of {Template}. It's called x our generated class, {x}, a subclass of {Template}. It's called x
because the source file was x.tmpl. because the source file was x.tmpl.
Lines 40-46 are the {.\_\_init\_\_} method called when the template Lines 40-46 are the {.\_\_init\_\_} method called when the template
is instantiated or used as a Webware servlet, or when the module is is instantiated or used as a Webware servlet, or when the module is
run as a standalone program. We can see it calling its superclass run as a standalone program. We can see it calling its superclass
constructor and setting {.\_filePath} and {.\_fileMtime} to the constructor and setting {.\_filePath} and {.\_fileMtime} to the
filename and modification time (in Unix ticks) of the source .tmpl filename and modification time (in Unix ticks) of the source .tmpl
file. file.
 End of changes. 3 change blocks. 
6 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)