Specify traceback offset, headers and color scheme. Define how many frames to drop from the tracebacks. Calling it with tb_offset=1 allows use of this handler in interpreters which will have their own code at the top of the traceback (VerboseTB will first remove that
(self, color_scheme='Linux', call_pdb=False, ostream=None,
tb_offset=0, long_header=False, include_vars=True,
check_cache=None, debugger_cls = None,
parent=None, config=None)
| 855 | would appear in the traceback).""" |
| 856 | |
| 857 | def __init__(self, color_scheme='Linux', call_pdb=False, ostream=None, |
| 858 | tb_offset=0, long_header=False, include_vars=True, |
| 859 | check_cache=None, debugger_cls = None, |
| 860 | parent=None, config=None): |
| 861 | """Specify traceback offset, headers and color scheme. |
| 862 | |
| 863 | Define how many frames to drop from the tracebacks. Calling it with |
| 864 | tb_offset=1 allows use of this handler in interpreters which will have |
| 865 | their own code at the top of the traceback (VerboseTB will first |
| 866 | remove that frame before printing the traceback info).""" |
| 867 | TBTools.__init__(self, color_scheme=color_scheme, call_pdb=call_pdb, |
| 868 | ostream=ostream, parent=parent, config=config) |
| 869 | self.tb_offset = tb_offset |
| 870 | self.long_header = long_header |
| 871 | self.include_vars = include_vars |
| 872 | # By default we use linecache.checkcache, but the user can provide a |
| 873 | # different check_cache implementation. This is used by the IPython |
| 874 | # kernel to provide tracebacks for interactive code that is cached, |
| 875 | # by a compiler instance that flushes the linecache but preserves its |
| 876 | # own code cache. |
| 877 | if check_cache is None: |
| 878 | check_cache = linecache.checkcache |
| 879 | self.check_cache = check_cache |
| 880 | |
| 881 | self.debugger_cls = debugger_cls or debugger.Pdb |
| 882 | self.skip_hidden = True |
| 883 | |
| 884 | def format_records(self, records, last_unique, recursion_repeat): |
| 885 | """Format the stack frames of the traceback""" |