equal
deleted
inserted
replaced
50 self._template = opts.get("template") |
50 self._template = opts.get("template") |
51 self._converter = converter |
51 self._converter = converter |
52 self._item = None |
52 self._item = None |
53 # function to convert node to string suitable for this output |
53 # function to convert node to string suitable for this output |
54 self.hexfunc = hex |
54 self.hexfunc = hex |
|
55 def __enter__(self): |
|
56 return self |
|
57 def __exit__(self, exctype, excvalue, traceback): |
|
58 if exctype is None: |
|
59 self.end() |
55 def __nonzero__(self): |
60 def __nonzero__(self): |
56 '''return False if we're not doing real templating so we can |
61 '''return False if we're not doing real templating so we can |
57 skip extra work''' |
62 skip extra work''' |
58 return True |
63 return True |
59 def _showitem(self): |
64 def _showitem(self): |