MCPcopy Index your code
hub / github.com/ipython/ipython / _lsmagic

Method _lsmagic

IPython/core/magics/basic.py:26–39  ·  view source on GitHub ↗

The main implementation of the %lsmagic

(self)

Source from the content-addressed store, hash-verified

24 self.magics_manager = magics_manager
25
26 def _lsmagic(self):
27 """The main implementation of the %lsmagic"""
28 mesc = magic_escapes['line']
29 cesc = magic_escapes['cell']
30 mman = self.magics_manager
31 magics = mman.lsmagic()
32 out = ['Available line magics:',
33 mesc + (' '+mesc).join(sorted([m for m,v in magics['line'].items() if (v not in self.ignore)])),
34 '',
35 'Available cell magics:',
36 cesc + (' '+cesc).join(sorted([m for m,v in magics['cell'].items() if (v not in self.ignore)])),
37 '',
38 mman.auto_status()]
39 return '\n'.join(out)
40
41 def _repr_pretty_(self, p, cycle):
42 p.text(self._lsmagic())

Callers 2

_repr_pretty_Method · 0.95
__str__Method · 0.95

Calls 2

auto_statusMethod · 0.80
lsmagicMethod · 0.45

Tested by

no test coverage detected