Skip to content

Commit

Permalink
move on_rtd check to top of module
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed Jul 22, 2017
1 parent e14b6f2 commit d4597ac
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
html_theme = 'default'

from unittest.mock import MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()

MOCK_MODULES = ['PyQt5']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

else:
html_theme = 'sphinx_rtd_theme'

from msl import qt

# -- General configuration ------------------------------------------------
Expand Down Expand Up @@ -96,25 +116,6 @@

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
html_theme = 'default'

from unittest.mock import MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()

MOCK_MODULES = ['PyQt5']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

else:
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down

0 comments on commit d4597ac

Please sign in to comment.