http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/roundup/cgi/engine_chameleon.py Mercurial Repository: p/roundup/code: roundup/cgi/engine_chameleon.py history 2024-05-26T11:14:10-04:00 fix: report filename if template file is invalid http://hg.code.sf.net:8000/p/roundup/code/#changeset-310e19beba3efc6c0d053c307adfb35262aa3f6a John Rouillard rouilj@ieee.org 2024-05-26T11:14:10-04:00 2024-05-26T11:14:10-04:00
changeset 310e19beba3e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: report filename if template file is invalid

A file name like .#issue.search.html causes a crash because _find
returns None not a tuple and unpacking fails.

Trap the TypeError and raise ValueError with message that includes the
basename of the file.
files
fix: typo in var name inan unused (mostly) chameleon engine. http://hg.code.sf.net:8000/p/roundup/code/#changeset-ac0802452818a045cfd527430443fc2a26a4a76f John Rouillard rouilj@ieee.org 2024-03-06T19:33:11-05:00 2024-03-06T19:33:11-05:00
changeset ac0802452818
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: typo in var name inan unused (mostly) chameleon engine.
files
chore: replace use of dir with template_dir. http://hg.code.sf.net:8000/p/roundup/code/#changeset-b8e63e65d9a84bfdec6b29c9e1f78a25d6884bdd John Rouillard rouilj@ieee.org 2024-03-04T18:51:41-05:00 2024-03-04T18:51:41-05:00
changeset b8e63e65d9a8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore: replace use of dir with template_dir.

variable 'dir' was shadowing a Python builtin.
files
flake8 whitespace; removed unused import os.path. http://hg.code.sf.net:8000/p/roundup/code/#changeset-4d20d8251bf234dc263cea22ca76f970b4db7a09 John Rouillard rouilj@ieee.org 2020-01-17T20:29:27-05:00 2020-01-17T20:29:27-05:00
changeset 4d20d8251bf2
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 whitespace; removed unused import os.path.
files
Python 3 preparation: StringIO. http://hg.code.sf.net:8000/p/roundup/code/#changeset-55f09ca366c484e1c06dd34a4efead3f1634d7d7 Joseph Myers jsm@polyomino.org.uk 2018-07-25T09:08:29+00:00 2018-07-25T09:08:29+00:00
changeset 55f09ca366c4
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: StringIO.

This generally arranges for StringIO and cStringIO references to use
io.StringIO for Python 3 but io.BytesIO for Python 2, consistent with
the string representations generally used in Roundup. A special
FasterStringIO in the TAL code, which referenced internals of the old
Python 2 StringIO module, is cut down so it doesn't actually do
anything beyond the StringIO class it inherits from (it would also be
reasonable to remove FasterStringIO completely). One place in
roundup_server.py clearly needing binary I/O is made to use io.BytesIO
unconditionally.
files
Python 3 preparation: unicode. http://hg.code.sf.net:8000/p/roundup/code/#changeset-56c9bcdea47f22412e4f0768775d1abea52d19c2 Joseph Myers jsm@polyomino.org.uk 2018-07-25T09:05:58+00:00 2018-07-25T09:05:58+00:00
changeset 56c9bcdea47f
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: unicode.

This patch introduces roundup/anypy/strings.py, which has a comment
explaining the string representations generally used and common
functions to handle the required conversions. Places in the code that
explicitly reference the "unicode" type / built-in function are
generally changed to use the new functions (or, in a few places where
those new functions don't seem to fit well, other approaches such as
references to type(u'') or use of the codecs module). This patch does
not generally attempt to address text conversions in any places not
currently referencing the "unicode" type (although
scripts/import_sf.py is made to use binary I/O in places as fixing the
"unicode" reference didn't seem coherent otherwise).
files
templating: Move common TAL methods to TALLoaderBase class http://hg.code.sf.net:8000/p/roundup/code/#changeset-0421390b309406902ce7056ea2cf07847e289d09 anatoly techtonik techtonik@gmail.com 2013-01-22T17:29:06+03:00 2013-01-22T17:29:06+03:00
changeset 0421390b3094
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description templating: Move common TAL methods to TALLoaderBase class
files
Untangle template selection logic from template loading functionality. http://hg.code.sf.net:8000/p/roundup/code/#changeset-fe9568a6cbd6398f3ff37077f3d72c409de4f9e2 anatoly techtonik techtonik@gmail.com 2013-01-15T00:10:01+03:00 2013-01-15T00:10:01+03:00
changeset fe9568a6cbd6
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description Untangle template selection logic from template loading functionality.
files
templating: Move template selection logic from the template loaders http://hg.code.sf.net:8000/p/roundup/code/#changeset-94be76e04140c395a7f1b02b79d287e1049e951b anatoly techtonik techtonik@gmail.com 2013-01-14T20:25:00+03:00 2013-01-14T20:25:00+03:00
changeset 94be76e04140
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description templating: Move template selection logic from the template loaders
to the client.
files
Revert 2b20294b934a (r2b20294b934a) disallowing load("issue.item") http://hg.code.sf.net:8000/p/roundup/code/#changeset-d82ce9ad804423dabebd507e33071011a3a60d04 anatoly techtonik techtonik@gmail.com 2013-01-14T19:57:42+03:00 2013-01-14T19:57:42+03:00
changeset d82ce9ad8044
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description Revert 2b20294b934a (r2b20294b934a) disallowing load("issue.item")
syntax for getting templates. This straightens template selection
logic a bit.
files
templating: Rename 'extension' argument in Loader.load() to 'view' http://hg.code.sf.net:8000/p/roundup/code/#changeset-4caa6de726a58bc9faadedea9a7970646bfa5553 anatoly techtonik techtonik@gmail.com 2013-01-14T00:13:58+03:00 2013-01-14T00:13:58+03:00
changeset 4caa6de726a5
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description templating: Rename 'extension' argument in Loader.load() to 'view'
to avoid confusion with file extension, and because this is what
this argument really does - specifies a different view for a class.
files
templating: Rename LoaderBase.get() to LoaderBase.load() for clarity http://hg.code.sf.net:8000/p/roundup/code/#changeset-5033c2ad80a7641519f1d7e53b16f55fa649885d anatoly techtonik techtonik@gmail.com 2013-01-13T22:39:46+03:00 2013-01-13T22:39:46+03:00
changeset 5033c2ad80a7
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description templating: Rename LoaderBase.get() to LoaderBase.load() for clarity
files
API break: rename Templates to Loader for zopetal and chameleon http://hg.code.sf.net:8000/p/roundup/code/#changeset-fd72576e07edef8d73a8d94994da29e1c0123ba2 anatoly techtonik techtonik@gmail.com 2013-01-06T16:36:33+03:00 2013-01-06T16:36:33+03:00
changeset fd72576e07ed
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description API break: rename Templates to Loader for zopetal and chameleon
engines.
files
API break, bumping version to 1.15.0, renamed TemplatesBase to http://hg.code.sf.net:8000/p/roundup/code/#changeset-05fe39f1d82330900794dc633941a993715a47f2 anatoly techtonik techtonik@gmail.com 2013-01-06T16:02:45+03:00 2013-01-06T16:02:45+03:00
changeset 05fe39f1d823
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description API break, bumping version to 1.15.0, renamed TemplatesBase to
LoaderBase to correctly reflect semantics and avoid confusion.
files
Fixes for RoundupPageTemplate in engine_chameleon.py. http://hg.code.sf.net:8000/p/roundup/code/#changeset-45ac4cd1a3816199b188f969f5823301641c0b48 Cheer Xiao xiaqqaix@gmail.com 2012-06-17T20:29:57+08:00 2012-06-17T20:29:57+08:00
changeset 45ac4cd1a381
branch
bookmark
tag
user Cheer Xiao <xiaqqaix@gmail.com>
description Fixes for RoundupPageTemplate in engine_chameleon.py.

* Follow Chameleon API change
* Inherit from object
files
New Chameleon templating engine, engine is now configurable. http://hg.code.sf.net:8000/p/roundup/code/#changeset-a2eb4fb3e6d8fcd01ac01c68d08d904df3077534 Ralf Schlatterbeck rsc@runtux.com 2012-02-23T18:10:03+01:00 2012-02-23T18:10:03+01:00
changeset a2eb4fb3e6d8
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description New Chameleon templating engine, engine is now configurable.
We now have two configurable templating engines, the old Zope TAL
templates (called zopetal in the config) and the new Chameleon (called
chameleon in the config). A new config-option "template_engine" under
[main] can take these config-options, the default is zopetal.
Thanks to Cheer Xiao for the idea of making this configurable *and*
for the actual implementation!
Cheer Xiao commit log:
- The original TAL engine ported from Zope is thereafter referred to as
"zopetal", in speech and in code
- A new option "template_engine" under [main] introduced
- Zopetal-specific code stripped from cgi/templating.py to form the new
cgi/engine_zopetal.py
- Interface to Chameleon in cgi/engine_chameleon.py
- Engines are supposed to provide a Templates class that mimics the
behavior of the old cgi.templating.Templates. The Templates class is
preferably subclassed from cgi.templating.TemplatesBase.
- New function cgi.templating.get_templates to get the appropriate engine's
Templates instance according to the engine name
files