Skip to content

Commit

Permalink
Fixed doc conf.py so it correctly sets PYTHONPATH for autodoc feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
tleonhardt committed Feb 12, 2017
1 parent f9d2414 commit 9abc056
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 7 additions & 1 deletion cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,13 @@ def do__relative_load(self, arg=None):
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
Expand Down
14 changes: 10 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +32,10 @@

# 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']
Expand Down Expand Up @@ -160,3 +163,6 @@
# -- 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']

0 comments on commit 9abc056

Please sign in to comment.