return a copy of the source object with
'before' and 'after' wrapped around it.
def putaround(self, before='', after='', indent=' ' * 4):
origin: code.Source
where:
function source:
def putaround(self, before='', after='', indent=' ' * 4):
""" return a copy of the source object with
'before' and 'after' wrapped around it.
"""
before = Source(before)
after = Source(after)
newsource = Source()
lines = [ (indent + line) for line in self.lines]
newsource.lines = before.lines + lines + after.lines
return newsource
called in /home/johnny/projects/merlinux/py/dist/py/code/testing/test_source.py
traceback code.Source.putaround.0
called in /home/johnny/projects/merlinux/py/dist/py/code/testing/test_source.py