summaryrefslogtreecommitdiff
path: root/cli.py
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2008-07-14 20:10:00 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2008-07-14 20:10:00 +0200
commit93ae11ba36e2a59e8d85c8dba4b8bde5a28ca206 (patch)
treecd39aed3f925679bc8a19676ce440703dcd0f6c5 /cli.py
parentaab929e273a41a188a244b5d2c8b3e53408172ab (diff)
downloadlogilab-common-93ae11ba36e2a59e8d85c8dba4b8bde5a28ca206.tar.gz
improve doc for better epydoc generation (again).
Diffstat (limited to 'cli.py')
-rw-r--r--cli.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/cli.py b/cli.py
index cc7c373..8c37f77 100644
--- a/cli.py
+++ b/cli.py
@@ -1,9 +1,9 @@
"""Command line interface helper classes.
It provides some default commands, a help system, a default readline
-configuration with completion and persistent history
+configuration with completion and persistent history.
-Exemple usage:
+Example::
class BookShell(CLIHelper):
@@ -36,7 +36,7 @@ if not hasattr(__builtin__, '_'):
def init_readline(complete_method, histfile=None):
- """init the readline library if available"""
+ """Init the readline library if available."""
try:
import readline
readline.parse_and_bind("tab: complete")
@@ -55,13 +55,13 @@ def init_readline(complete_method, histfile=None):
class Completer :
- """readline completer"""
+ """Readline completer."""
def __init__(self, commands):
self.list = commands
def complete(self, text, state):
- """hook called by readline when <tab> is pressed"""
+ """Hook called by readline when <tab> is pressed."""
n = len(text)
matches = []
for cmd in self.list :
@@ -74,8 +74,8 @@ class Completer :
class CLIHelper:
- """ an abstract command line interface client which recognize commands
- and provide an help system
+ """An abstract command line interface client which recognize commands
+ and provide an help system.
"""
CMD_MAP = {'help' : _("Others"),
@@ -118,9 +118,8 @@ class CLIHelper:
traceback.print_exc()
def handle_line(self, stripped_line):
- """method to overload in the concrete class
-
- should handle lines wich are not command
+ """Method to overload in the concrete class (should handle
+ lines wich are not commands).
"""
raise NotImplementedError()