summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Vu-Brugier <cvubrugier@fastmail.fm>2019-07-28 18:19:59 +0200
committerChristophe Vu-Brugier <cvubrugier@fastmail.fm>2019-07-28 20:18:17 +0200
commit2c2d91e430fe841ee0afe8deaec318b74d756cee (patch)
tree4c1de3dea927b053c88990413a34e3db20a28f27
parentc8ea2bf6b2e58296c9061f7c9f6f96a28d9c7937 (diff)
downloadconfigshell-fb-2c2d91e430fe841ee0afe8deaec318b74d756cee.tar.gz
Remove epydoc imports and epydoc calls
Epydoc is no longer maintained and only supported for Python 2 whereas most distributions package targetcli-fb for Python 3 (RHEL, Fedora, Debian). As a consequence, the help messages for configshell commands are not rendered with Epydoc on most systems and it is probably safe to remove the Epydoc dependency entirely. For more information, see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881554 Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
-rw-r--r--configshell/console.py31
1 files changed, 9 insertions, 22 deletions
diff --git a/configshell/console.py b/configshell/console.py
index 8ed6b50..80e723c 100644
--- a/configshell/console.py
+++ b/configshell/console.py
@@ -26,12 +26,6 @@ import tty
from .prefs import Prefs
-# avoid requiring epydoc at runtime
-try:
- import epydoc.markup.epytext
-except ImportError:
- pass
-
class Console(object):
'''
Implements various utility methods providing a console UI support toolkit,
@@ -166,19 +160,12 @@ class Console(object):
Renders and print and epytext-formatted text on the console.
'''
text = self.dedent(text)
- try:
- dom_tree = epydoc.markup.epytext.parse(text, None)
- except NameError:
- # epydoc not installed, strip markup
- dom_tree = text
- dom_tree = dom_tree.replace("B{", "")
- dom_tree = dom_tree.replace("I{", "")
- dom_tree = dom_tree.replace("C{", "")
- dom_tree = dom_tree.replace("}", "")
- dom_tree += "\n"
- except:
- self.display(text)
- raise
+ dom_tree = text
+ dom_tree = dom_tree.replace("B{", "")
+ dom_tree = dom_tree.replace("I{", "")
+ dom_tree = dom_tree.replace("C{", "")
+ dom_tree = dom_tree.replace("}", "")
+ dom_tree += "\n"
text = self.render_domtree(dom_tree)
# We need to remove the last line feed, but there might be
# escape characters after it...
@@ -412,9 +399,9 @@ class Console(object):
text = self.render_text(
childstr, styles=['underline'], todefault=True)
elif tree.tag == 'symbol':
- text = '%s' \
- % epydoc.markup.epytext.SYMBOL_TO_PLAINTEXT.get(
- childstr, childstr)
+ # Should not occur because this module does not have
+ # docstrings with symbols (e.g. S{alpha}).
+ raise NotImplementedError
elif tree.tag == 'graph':
text = '<<%s graph: %s>>' \
% (variables[0], ', '.join(variables[1:]))