MCPcopy Create free account
hub / github.com/ipython/ipython / set_mode

Method set_mode

IPython/core/ultratb.py:1354–1371  ·  view source on GitHub ↗

Switch to the desired mode. If mode is not specified, cycles through the available modes.

(self, mode=None)

Source from the content-addressed store, hash-verified

1352
1353
1354 def set_mode(self, mode=None):
1355 """Switch to the desired mode.
1356
1357 If mode is not specified, cycles through the available modes."""
1358
1359 if not mode:
1360 new_idx = (self.valid_modes.index(self.mode) + 1 ) % \
1361 len(self.valid_modes)
1362 self.mode = self.valid_modes[new_idx]
1363 elif mode not in self.valid_modes:
1364 raise ValueError('Unrecognized mode in FormattedTB: <' + mode + '>\n'
1365 'Valid modes: ' + str(self.valid_modes))
1366 else:
1367 self.mode = mode
1368 # include variable details only in 'Verbose' mode
1369 self.include_vars = (self.mode == self.valid_modes[2])
1370 # Set the join character for generating text tracebacks
1371 self.tb_join_char = self._join_chars[self.mode]
1372
1373 # some convenient shortcuts
1374 def plain(self):

Callers 8

__init__Method · 0.95
plainMethod · 0.95
contextMethod · 0.95
verboseMethod · 0.95
minimalMethod · 0.95
tbMethod · 0.80
xmodeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected