functions respectively.
"""
-import inspect, string, sys
+import sys
__all__ = ["Cmd"]
PROMPT = '(Cmd) '
-IDENTCHARS = string.ascii_letters + string.digits + '_'
+IDENTCHARS = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ 'abcdefghijklmnopqrstuvwxyz'
+ '0123456789'
+ '_')
class Cmd:
"""A simple framework for writing line-oriented command interpreters.
try:
func = getattr(self, 'help_' + arg)
except AttributeError:
+ from inspect import cleandoc
+
try:
doc=getattr(self, 'do_' + arg).__doc__
- doc = inspect.cleandoc(doc)
+ doc = cleandoc(doc)
if doc:
self.stdout.write("%s\n"%str(doc))
return