"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/ezt.py" between
viewvc-1.1.28.tar.gz and viewvc-1.2.1.tar.gz

About: ViewVC is a browser interface for CVS and Subversion version control repositories.

ezt.py  (viewvc-1.1.28):ezt.py  (viewvc-1.2.1)
skipping to change at line 687 skipping to change at line 687
# plain old value, write to output # plain old value, write to output
else: else:
_print_formatted(formatters, ctx, value) _print_formatted(formatters, ctx, value)
finally: finally:
# restore our formatters # restore our formatters
formatters.reverse() formatters.reverse()
ctx.formatters = formatters ctx.formatters = formatters
class TemplateData:
"""A custom dictionary-like object that allows one-time definition
of keys, and only value fetches and changes, and key deletions,
EZT doesn't require the use of this special class -- a normal
dict-type data dictionary works fine. But use of this class will
assist those who want the data sent to their templates to have a
consistent set of keys."""
def __init__(self, initial_data={}):
self._items = initial_data
def __getitem__(self, key):
return self._items.__getitem__(key)
def __setitem__(self, key, item):
assert self._items.has_key(key)
return self._items.__setitem__(key, item)
def __delitem__(self, key):
return self._items.__delitem__(key)
def keys(self):
return self._items.keys()
def merge(self, template_data):
"""Merge the data in TemplataData instance TEMPLATA_DATA into this
instance. Avoid the temptation to use this conditionally in your
code -- it rather defeats the purpose of this class."""
assert isinstance(template_data, TemplateData)
class Context: class Context:
"""A container for the execution context""" """A container for the execution context"""
def __init__(self, fp): def __init__(self, fp):
self.fp = fp self.fp = fp
self.formatters = [] self.formatters = []
def write(self, value, args=()): def write(self, value, args=()):
_write_value(value, args, self) _write_value(value, args, self)
class Reader: class Reader:
"Abstract class which allows EZT to detect Reader objects." "Abstract class which allows EZT to detect Reader objects."
 End of changes. 1 change blocks. 
34 lines changed or deleted 0 lines changed or added

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