diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-09-12 15:06:58 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-09-12 15:06:58 +0000 |
| commit | 9ed0670e48665f590eda685e0cfebf8c4cadb8fb (patch) | |
| tree | a3f909876ca336256b304de9a350ab526d16abea /website | |
| parent | 73d9c98f92b9664c6d78843c4110b71520fa3f67 (diff) | |
| download | lasso-9ed0670e48665f590eda685e0cfebf8c4cadb8fb.tar.gz lasso-9ed0670e48665f590eda685e0cfebf8c4cadb8fb.tar.xz lasso-9ed0670e48665f590eda685e0cfebf8c4cadb8fb.zip | |
* Remove ending blanks
Diffstat (limited to 'website')
| -rw-r--r-- | website/convert-to-static.py | 6 | ||||
| -rw-r--r-- | website/ezt.py | 54 |
2 files changed, 30 insertions, 30 deletions
diff --git a/website/convert-to-static.py b/website/convert-to-static.py index 4aaadcd1..c6e4b4a3 100644 --- a/website/convert-to-static.py +++ b/website/convert-to-static.py @@ -18,7 +18,7 @@ changelog_template.parse(file('templates/changelog.ezt').read()) tests_template = ezt.Template() tests_template.parse(file('templates/tests.ezt').read()) -def getText(nodelist): +def getText(nodelist): if not nodelist: return None rc = '' @@ -158,7 +158,7 @@ for BUILDLOGS_DIR in ('build-logs', 'build-logs-wsf'): if src_file.endswith('.html'): try: body = re_body.findall(file(src_file).read())[0][1].strip() - except IndexError: + except IndexError: raise "no body found" fd = StringIO() base_template.generate(fd, {'body': body, 'title': 'Build Log', 'section': 'buildbox'}) @@ -287,7 +287,7 @@ for base, dirs, files in os.walk('web'): content = file(src_file).read() try: body = re_body.findall(content)[0][1].strip() - except IndexError: + except IndexError: raise "no body found" title = re_title.findall(content)[0] fd = StringIO() diff --git a/website/ezt.py b/website/ezt.py index 01c39a6b..3cc79c5a 100644 --- a/website/ezt.py +++ b/website/ezt.py @@ -19,7 +19,7 @@ EZT files (convention: use the suffix .ezt for such files): >>> template = Template("../templates/log.ezt") -or by calling the parse() method of a template instance directly with +or by calling the parse() method of a template instance directly with a EZT template string: >>> template = Template() @@ -53,7 +53,7 @@ with the output fileobject to the templates generate method: </body> </html> -Template syntax error reporting should be improved. Currently it is +Template syntax error reporting should be improved. Currently it is very sparse (template line numbers would be nice): >>> Template().parse("[if-any where] foo [else] bar [end unexpected args]") @@ -78,7 +78,7 @@ Directives ========== Several directives allow the use of dotted qualified names refering to objects - or attributes of objects contained in the data dictionary given to the + or attributes of objects contained in the data dictionary given to the .generate() method. Qualified names @@ -103,7 +103,7 @@ Directives [QUAL_NAME] This directive is simply replaced by the value of the qualified name. - If the value is a number it's converted to a string before being + If the value is a number it's converted to a string before being outputted. If it is None, nothing is outputted. If it is a python file object (i.e. any object with a "read" method), it's contents are outputted. If it is a callback function (any callable python object @@ -138,7 +138,7 @@ Directives ---------------- [for QUAL_NAME] ... [end] - + The text within the [for ...] directive and the corresponding [end] is repeated for each element in the sequence referred to by the qualified name in the for directive. Within the for block this @@ -188,7 +188,7 @@ Directives The format directive controls how the values substituted into templates are escaped before they are put into the output stream. It has no effect on the literal text of the templates, only the output - from [QUAL_NAME ...] directives. STRING can be one of "raw" "html" + from [QUAL_NAME ...] directives. STRING can be one of "raw" "html" or "xml". The "raw" mode leaves the output unaltered. The "html" and "xml" modes escape special characters using entity escapes (like " and >) @@ -196,27 +196,27 @@ Directives # # Copyright (C) 2001-2005 Greg Stein. All Rights Reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are # met: # -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. # -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # @@ -543,7 +543,7 @@ def _prepare_ref(refname, for_names, file_args): """refname -> a string containing a dotted identifier. example:"foo.bar.bang" for_names -> a list of active for sequences. - Returns a `value reference', a 3-tuple made out of (refname, start, rest), + Returns a `value reference', a 3-tuple made out of (refname, start, rest), for fast access later. """ # is the reference a string constant? @@ -591,8 +591,8 @@ def _get_value((refname, start, rest), ctx): """(refname, start, rest) -> a prepared `value reference' (see above). ctx -> an execution context instance. - Does a name space lookup within the template name space. Active - for blocks take precedence over data dictionary members with the + Does a name space lookup within the template name space. Active + for blocks take precedence over data dictionary members with the same name. """ if rest is None: @@ -729,7 +729,7 @@ def test_parse(): ['', '["a \\"b[foo]" c.d f]', None, ''] def _test(argv): - import doctest, ezt + import doctest, ezt verbose = "-v" in argv return doctest.testmod(ezt, verbose=verbose) |
