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

Method _lsmagic

IPython/core/magics/basic.py:25–38  ·  view source on GitHub ↗

The main implementation of the %lsmagic

(self)

Source from the content-addressed store, hash-verified

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