Skip to content

Commit 35c9e79

Browse files
tannewtdhalbert
authored andcommitted
Fix up ReadTheDocs. (#9)
1 parent e985f91 commit 35c9e79

File tree

3 files changed

+150
-2
lines changed

3 files changed

+150
-2
lines changed

adafruit_pca9685.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def duty_cycle(self, value):
7474
self._pca.pwm_regs[self._index].__set__(self._pca, (0, value))
7575

7676
class PCAChannels: # pylint: disable=too-few-public-methods
77-
"""Lazily creates and caches channel objects as needed."""
77+
"""Lazily creates and caches channel objects as needed. Treat it like a sequence."""
7878
def __init__(self, pca):
7979
self._pca = pca
8080
self._channels = [None] * len(self)
@@ -122,7 +122,9 @@ class PCA9685:
122122
def __init__(self, i2c_bus, *, address=0x40, reference_clock_speed=25000000):
123123
self.i2c_device = i2c_device.I2CDevice(i2c_bus, address)
124124
self.channels = PCAChannels(self)
125+
"""Sequence of 16 `PWMChannel` objects. One for each channel."""
125126
self.reference_clock_speed = reference_clock_speed
127+
"""The reference clock speed in Hz."""
126128
self.reset()
127129

128130
def reset(self):

api.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
.. If you created a package, create one automodule per module in the package.
33
4-
.. automodule:: adafruit_thermistor
4+
.. automodule:: adafruit_pca9685
55
:members:

conf.py

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import os
4+
import sys
5+
sys.path.insert(0, os.path.abspath('.'))
6+
7+
# -- General configuration ------------------------------------------------
8+
9+
# Add any Sphinx extension module names here, as strings. They can be
10+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
11+
# ones.
12+
extensions = [
13+
'sphinx.ext.autodoc',
14+
'sphinx.ext.intersphinx',
15+
'sphinx.ext.viewcode',
16+
]
17+
18+
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
19+
'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
20+
21+
# Libraries we depend on but don't need for generating docs.
22+
autodoc_mock_imports = ['adafruit_bus_device', 'adafruit_register']
23+
24+
# Add any paths that contain templates here, relative to this directory.
25+
templates_path = ['_templates']
26+
27+
source_suffix = '.rst'
28+
29+
# The master toctree document.
30+
master_doc = 'README'
31+
32+
# General information about the project.
33+
project = u'Adafruit PCA9685 Library'
34+
copyright = u'2016 Radomir Dopieralski, 2017 Scott Shawcroft'
35+
author = u'Radomir Dopieralski'
36+
37+
# The version info for the project you're documenting, acts as replacement for
38+
# |version| and |release|, also used in various other places throughout the
39+
# built documents.
40+
#
41+
# The short X.Y version.
42+
version = u'1.0'
43+
# The full version, including alpha/beta/rc tags.
44+
release = u'1.0'
45+
46+
# The language for content autogenerated by Sphinx. Refer to documentation
47+
# for a list of supported languages.
48+
#
49+
# This is also used if you do content translation via gettext catalogs.
50+
# Usually you set "language" from the command line for these cases.
51+
language = None
52+
53+
# List of patterns, relative to source directory, that match files and
54+
# directories to ignore when looking for source files.
55+
# This patterns also effect to html_static_path and html_extra_path
56+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env']
57+
58+
# The reST default role (used for this markup: `text`) to use for all
59+
# documents.
60+
#
61+
default_role = "any"
62+
63+
# If true, '()' will be appended to :func: etc. cross-reference text.
64+
#
65+
add_function_parentheses = True
66+
67+
# The name of the Pygments (syntax highlighting) style to use.
68+
pygments_style = 'sphinx'
69+
70+
# If true, `todo` and `todoList` produce output, else they produce nothing.
71+
todo_include_todos = False
72+
73+
74+
# -- Options for HTML output ----------------------------------------------
75+
76+
# The theme to use for HTML and HTML Help pages. See the documentation for
77+
# a list of builtin themes.
78+
#
79+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
80+
81+
if not on_rtd: # only import and set the theme if we're building docs locally
82+
try:
83+
import sphinx_rtd_theme
84+
html_theme = 'sphinx_rtd_theme'
85+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
86+
except:
87+
html_theme = 'default'
88+
html_theme_path = ['.']
89+
else:
90+
html_theme_path = ['.']
91+
92+
# Add any paths that contain custom static files (such as style sheets) here,
93+
# relative to this directory. They are copied after the builtin static files,
94+
# so a file named "default.css" will overwrite the builtin "default.css".
95+
html_static_path = ['_static']
96+
97+
# Output file base name for HTML help builder.
98+
htmlhelp_basename = 'AdafruitPCA9685Librarydoc'
99+
100+
# -- Options for LaTeX output ---------------------------------------------
101+
102+
latex_elements = {
103+
# The paper size ('letterpaper' or 'a4paper').
104+
#
105+
# 'papersize': 'letterpaper',
106+
107+
# The font size ('10pt', '11pt' or '12pt').
108+
#
109+
# 'pointsize': '10pt',
110+
111+
# Additional stuff for the LaTeX preamble.
112+
#
113+
# 'preamble': '',
114+
115+
# Latex figure (float) alignment
116+
#
117+
# 'figure_align': 'htbp',
118+
}
119+
120+
# Grouping the document tree into LaTeX files. List of tuples
121+
# (source start file, target name, title,
122+
# author, documentclass [howto, manual, or own class]).
123+
latex_documents = [
124+
(master_doc, 'AdafruitPCA9685Library.tex', u'Adafruit PCA9685 Library Documentation',
125+
author, 'manual'),
126+
]
127+
128+
# -- Options for manual page output ---------------------------------------
129+
130+
# One entry per manual page. List of tuples
131+
# (source start file, name, description, authors, manual section).
132+
man_pages = [
133+
(master_doc, 'adafruitPCA9685library', u'Adafruit PCA9685 Library Documentation',
134+
[author], 1)
135+
]
136+
137+
# -- Options for Texinfo output -------------------------------------------
138+
139+
# Grouping the document tree into Texinfo files. List of tuples
140+
# (source start file, target name, title, author,
141+
# dir menu entry, description, category)
142+
texinfo_documents = [
143+
(master_doc, 'AdafruitPCA9685Library', u'Adafruit PCA9685 Library Documentation',
144+
author, 'AdafruitPCA9685Library', 'One line description of project.',
145+
'Miscellaneous'),
146+
]

0 commit comments

Comments
 (0)