Module xyaptu
source code
This code is taken from the ASPN Python cookbook. I have combined
YAPTU and XYAPTU into a single file. The copyright, warranty and license
remain with the original authors. Please consult these two URLs
The following changes were made:
-
Removed very lengthy examples from the end (see the above URLs for
them)
-
Added: setupxcopy() takes the template text and remembers it
-
Added: xcopywithdns() does the copy with supplied DNS (Document Name
Space which is a dict of variables) and remembered template and
returns the resulting string
-
Exception handling for statements was added (xyaptu only did it for
expressions)
-
The default behaviour for exceptions now puts a dump of the exception
into the generated output as an HTML <!-- --> style comment so
you can view source to find out what has happened. My common library
exception formatter (which also dumps local variables) is used.
|
_nevermatch
Polymorphic with a regex that never matches
|
|
copier
Smart-copier (YAPTU) class
|
|
xcopier
xcopier class, inherits from yaptu.copier
|
|
identity(string,
why)
A do-nothing-special-to-the-input, just-return-it function |
source code
|
|
|
nohandle(*args)
A do-nothing handler that just re-raises the exception |
source code
|
|