INNER CODE UNIT · Python
pad
probcomp/bayeslite · shell/src/core.py:159
pad = max(1 + len(cmd) for cmd in self._cmds)
for cmnd in sorted(self._cmds):
method = getattr(self, 'do_.%s' % (cmnd,))
if method.__doc__ is not None:
doc = [l.strip() for l in method.__doc__.splitlines()]
else:
doc = ['', '']
assert 1 < len(doc)
self.stdout.write(' %*s %s\n' % (pad, '.' + cmnd, doc[0]))
self.stdout.write('Type `.help <cmd>\''
' for help on the command <cmd>.\n')
else:
for cmnd in tokens:
if not hasattr(self, 'do_.%s' % (cmnd,)):
self.stdout.write('No such command %s.\n' % (repr(cmnd),))
return
method = getattr(self, 'do_.%s' % (cmnd,))
if method.__doc__ is not None: