return a new source object deindented by offset.
If offset is None then guess an indentation offset from
the first non-blank line. Subsequent lines which have a
lower indentation offset will be copied verbatim as
they are assumed to be part of multilines.
def deindent(self, offset=None):
origin: code.Source
where:
function source:
def deindent(self, offset=None):
""" return a new source object deindented by offset.
If offset is None then guess an indentation offset from
the first non-blank line. Subsequent lines which have a
lower indentation offset will be copied verbatim as
they are assumed to be part of multilines.
"""
# XXX maybe use the tokenizer to properly handle multiline
# strings etc.pp?
newsource = Source()
newsource.lines[:] = deindent(self.lines, offset)
return newsource
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.0
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.1
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.2
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.3
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.4
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.5
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.6
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.7
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.8
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.9
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.10
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.11
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.12
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.13
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.14
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.15
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.16
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.17
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.18
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py
traceback code.Source.deindent.19
called in /home/johnny/projects/merlinux/py/dist/py/code/source.py