"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Cheetah/Template.py" between
cheetah3-3.2.1.tar.gz and cheetah3-3.2.2.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).

Template.py  (cheetah3-3.2.1):Template.py  (cheetah3-3.2.2)
skipping to change at line 895 skipping to change at line 895
@classmethod @classmethod
def _normalizePreprocessorArg(klass, arg): def _normalizePreprocessorArg(klass, arg):
"""Used to convert the items in the .compile() classmethod's """Used to convert the items in the .compile() classmethod's
preprocessors argument into real source preprocessors. preprocessors argument into real source preprocessors.
This permits the use of several shortcut forms This permits the use of several shortcut forms
for defining preprocessors. for defining preprocessors.
""" """
if hasattr(arg, 'preprocess'): if hasattr(arg, 'preprocess'):
return arg return arg
elif hasattr(arg, '__call__'): elif callable(arg):
class WrapperPreprocessor: class WrapperPreprocessor:
def preprocess(self, source, file): def preprocess(self, source, file):
return arg(source, file) return arg(source, file)
return WrapperPreprocessor() return WrapperPreprocessor()
else: else:
class Settings(object): class Settings(object):
placeholderToken = None placeholderToken = None
directiveToken = None directiveToken = None
settings = Settings() settings = Settings()
if isinstance(arg, str) or isinstance(arg, (list, tuple)): if isinstance(arg, str) or isinstance(arg, (list, tuple)):
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

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