INNER CODE UNIT · Python
_installcmd
probcomp/bayeslite · shell/src/core.py:83
def _installcmd(self, name, method):
assert not hasattr(self, 'do_.%s' % (name,))
assert name not in self._cmds
setattr(self, 'do_.%s' % (name,), method)
self._cmds.add(name)
def _uninstallcmd(self, name):
if name in self._core_commands:
raise ValueError('Cannot uninstall core command: %s' % (name,))
delattr(self, 'do_.%s' % (name,))
self._cmds.remove(name)
def cmdloop(self, *args, **kwargs):
version = bayeslite.__version__
self.stdout.write('Welcome to the Bayeslite %s shell.\n' % (version,))
self.stdout.write('Type `.help\' for help.\n')
while True:
try: