summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-02-12 12:11:49 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-02-12 12:11:49 -0500
commit9abc056a1be5ee5e06f6313d61e639e851797502 (patch)
tree3a6ed4e438091cd47b46bcf374dcf08154537722
parentf9d241418862d9ee6d680c6f4474363e50bc617f (diff)
downloadcmd2-git-9abc056a1be5ee5e06f6313d61e639e851797502.tar.gz
Fixed doc conf.py so it correctly sets PYTHONPATH for autodoc feature.
-rwxr-xr-xcmd2.py8
-rw-r--r--docs/conf.py14
2 files changed, 17 insertions, 5 deletions
diff --git a/cmd2.py b/cmd2.py
index 3a198f8c..b5bb13a9 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1455,7 +1455,13 @@ class Cmd(cmd.Cmd):
self.do_load('%s %s' % (targetname, args))
def do_load(self, arg=None):
- """Runs script of command(s) from a file or URL."""
+ """Runs script of command(s) from a file or URL.
+
+ Script should contain one command per line, just like command would be typed in console.
+
+ :param arg: str - Path of file to load and run commands from.
+ :return: bool - True if application should stop (script contained 'quit', typically False to continue running.
+ """
# If arg is None or arg is an empty string, use the default filename
if not arg:
targetname = self.default_file_name
diff --git a/docs/conf.py b/docs/conf.py
index fdd6db8c..d1e20119 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,9 +17,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+import os
+import sys
+sys.path.insert(0, os.path.abspath('..'))
# Import for custom theme from Read the Docs
import sphinx_rtd_theme
@@ -32,7 +32,10 @@ import sphinx_rtd_theme
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']
+extensions = ['sphinx.ext.autodoc',
+ 'sphinx.ext.intersphinx',
+ 'sphinx.ext.doctest',
+ 'sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -160,3 +163,6 @@ texinfo_documents = [
# -- Options for Extensions -------------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
+
+# Mock 3rd-party dependencies so they don't need to be installed for building docs
+autodoc_mock_imports = ['six']