Skip to content

Commit d34240d

Browse files
Start documentation.
1 parent 7cbdcf5 commit d34240d

File tree

3 files changed

+379
-0
lines changed

3 files changed

+379
-0
lines changed

canopen/network.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313

1414
class Network(collections.Mapping):
15+
"""Representation of one CAN bus containing one or more nodes."""
1516

1617
def __init__(self):
18+
#: python-can :class:`can.BusABC` instance
1719
self.bus = None
1820
self.listeners = [MessageDispatcher(self)]
1921
self.notifier = None
@@ -24,6 +26,10 @@ def __init__(self):
2426
#self.nmt = NmtNode(0)
2527

2628
def connect(self, *args, **kwargs):
29+
"""Connect to CAN bus using python-can.
30+
31+
Arguments are passed to :class:`can.BusABC`.
32+
"""
2733
# If bitrate has not been specified, try to find one node where bitrate
2834
# has been specified
2935
if "bitrate" not in kwargs:

doc/conf.py

Lines changed: 349 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,349 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# canopen documentation build configuration file, created by
4+
# sphinx-quickstart on Mon Sep 19 22:15:46 2016.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
#
19+
import os
20+
import sys
21+
sys.path.insert(0, os.path.abspath('..'))
22+
23+
# -- General configuration ------------------------------------------------
24+
25+
# If your documentation needs a minimal Sphinx version, state it here.
26+
#
27+
# needs_sphinx = '1.0'
28+
29+
# Add any Sphinx extension module names here, as strings. They can be
30+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31+
# ones.
32+
extensions = [
33+
'sphinx.ext.autodoc',
34+
'sphinx.ext.intersphinx',
35+
'sphinx.ext.viewcode',
36+
]
37+
38+
# Add any paths that contain templates here, relative to this directory.
39+
templates_path = ['_templates']
40+
41+
# The suffix(es) of source filenames.
42+
# You can specify multiple suffix as a list of string:
43+
#
44+
# source_suffix = ['.rst', '.md']
45+
source_suffix = '.rst'
46+
47+
# The encoding of source files.
48+
#
49+
# source_encoding = 'utf-8-sig'
50+
51+
# The master toctree document.
52+
master_doc = 'index'
53+
54+
# General information about the project.
55+
project = u'canopen'
56+
copyright = u'2016, Christian Sandberg'
57+
author = u'Christian Sandberg'
58+
59+
# The version info for the project you're documenting, acts as replacement for
60+
# |version| and |release|, also used in various other places throughout the
61+
# built documents.
62+
#
63+
# The short X.Y version.
64+
version = u'0.3'
65+
# The full version, including alpha/beta/rc tags.
66+
release = u'0.3.0'
67+
68+
# The language for content autogenerated by Sphinx. Refer to documentation
69+
# for a list of supported languages.
70+
#
71+
# This is also used if you do content translation via gettext catalogs.
72+
# Usually you set "language" from the command line for these cases.
73+
language = None
74+
75+
# There are two options for replacing |today|: either, you set today to some
76+
# non-false value, then it is used:
77+
#
78+
# today = ''
79+
#
80+
# Else, today_fmt is used as the format for a strftime call.
81+
#
82+
# today_fmt = '%B %d, %Y'
83+
84+
# List of patterns, relative to source directory, that match files and
85+
# directories to ignore when looking for source files.
86+
# This patterns also effect to html_static_path and html_extra_path
87+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
88+
89+
# The reST default role (used for this markup: `text`) to use for all
90+
# documents.
91+
#
92+
# default_role = None
93+
94+
# If true, '()' will be appended to :func: etc. cross-reference text.
95+
#
96+
# add_function_parentheses = True
97+
98+
# If true, the current module name will be prepended to all description
99+
# unit titles (such as .. function::).
100+
#
101+
# add_module_names = True
102+
103+
# If true, sectionauthor and moduleauthor directives will be shown in the
104+
# output. They are ignored by default.
105+
#
106+
# show_authors = False
107+
108+
# The name of the Pygments (syntax highlighting) style to use.
109+
pygments_style = 'sphinx'
110+
111+
# A list of ignored prefixes for module index sorting.
112+
# modindex_common_prefix = []
113+
114+
# If true, keep warnings as "system message" paragraphs in the built documents.
115+
# keep_warnings = False
116+
117+
# If true, `todo` and `todoList` produce output, else they produce nothing.
118+
todo_include_todos = False
119+
120+
121+
# -- Options for HTML output ----------------------------------------------
122+
123+
# The theme to use for HTML and HTML Help pages. See the documentation for
124+
# a list of builtin themes.
125+
#
126+
html_theme = 'alabaster'
127+
128+
# Theme options are theme-specific and customize the look and feel of a theme
129+
# further. For a list of options available for each theme, see the
130+
# documentation.
131+
#
132+
# html_theme_options = {}
133+
134+
# Add any paths that contain custom themes here, relative to this directory.
135+
# html_theme_path = []
136+
137+
# The name for this set of Sphinx documents.
138+
# "<project> v<release> documentation" by default.
139+
#
140+
# html_title = u'canopen v0.3.0'
141+
142+
# A shorter title for the navigation bar. Default is the same as html_title.
143+
#
144+
# html_short_title = None
145+
146+
# The name of an image file (relative to this directory) to place at the top
147+
# of the sidebar.
148+
#
149+
# html_logo = None
150+
151+
# The name of an image file (relative to this directory) to use as a favicon of
152+
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
153+
# pixels large.
154+
#
155+
# html_favicon = None
156+
157+
# Add any paths that contain custom static files (such as style sheets) here,
158+
# relative to this directory. They are copied after the builtin static files,
159+
# so a file named "default.css" will overwrite the builtin "default.css".
160+
html_static_path = ['_static']
161+
162+
# Add any extra paths that contain custom files (such as robots.txt or
163+
# .htaccess) here, relative to this directory. These files are copied
164+
# directly to the root of the documentation.
165+
#
166+
# html_extra_path = []
167+
168+
# If not None, a 'Last updated on:' timestamp is inserted at every page
169+
# bottom, using the given strftime format.
170+
# The empty string is equivalent to '%b %d, %Y'.
171+
#
172+
# html_last_updated_fmt = None
173+
174+
# If true, SmartyPants will be used to convert quotes and dashes to
175+
# typographically correct entities.
176+
#
177+
# html_use_smartypants = True
178+
179+
# Custom sidebar templates, maps document names to template names.
180+
#
181+
# html_sidebars = {}
182+
183+
# Additional templates that should be rendered to pages, maps page names to
184+
# template names.
185+
#
186+
# html_additional_pages = {}
187+
188+
# If false, no module index is generated.
189+
#
190+
# html_domain_indices = True
191+
192+
# If false, no index is generated.
193+
#
194+
# html_use_index = True
195+
196+
# If true, the index is split into individual pages for each letter.
197+
#
198+
# html_split_index = False
199+
200+
# If true, links to the reST sources are added to the pages.
201+
#
202+
# html_show_sourcelink = True
203+
204+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
205+
#
206+
# html_show_sphinx = True
207+
208+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
209+
#
210+
# html_show_copyright = True
211+
212+
# If true, an OpenSearch description file will be output, and all pages will
213+
# contain a <link> tag referring to it. The value of this option must be the
214+
# base URL from which the finished HTML is served.
215+
#
216+
# html_use_opensearch = ''
217+
218+
# This is the file name suffix for HTML files (e.g. ".xhtml").
219+
# html_file_suffix = None
220+
221+
# Language to be used for generating the HTML full-text search index.
222+
# Sphinx supports the following languages:
223+
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
224+
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
225+
#
226+
# html_search_language = 'en'
227+
228+
# A dictionary with options for the search language support, empty by default.
229+
# 'ja' uses this config value.
230+
# 'zh' user can custom change `jieba` dictionary path.
231+
#
232+
# html_search_options = {'type': 'default'}
233+
234+
# The name of a javascript file (relative to the configuration directory) that
235+
# implements a search results scorer. If empty, the default will be used.
236+
#
237+
# html_search_scorer = 'scorer.js'
238+
239+
# Output file base name for HTML help builder.
240+
htmlhelp_basename = 'canopendoc'
241+
242+
# -- Options for LaTeX output ---------------------------------------------
243+
244+
latex_elements = {
245+
# The paper size ('letterpaper' or 'a4paper').
246+
#
247+
# 'papersize': 'letterpaper',
248+
249+
# The font size ('10pt', '11pt' or '12pt').
250+
#
251+
# 'pointsize': '10pt',
252+
253+
# Additional stuff for the LaTeX preamble.
254+
#
255+
# 'preamble': '',
256+
257+
# Latex figure (float) alignment
258+
#
259+
# 'figure_align': 'htbp',
260+
}
261+
262+
# Grouping the document tree into LaTeX files. List of tuples
263+
# (source start file, target name, title,
264+
# author, documentclass [howto, manual, or own class]).
265+
latex_documents = [
266+
(master_doc, 'canopen.tex', u'canopen Documentation',
267+
u'Christian Sandberg', 'manual'),
268+
]
269+
270+
# The name of an image file (relative to this directory) to place at the top of
271+
# the title page.
272+
#
273+
# latex_logo = None
274+
275+
# For "manual" documents, if this is true, then toplevel headings are parts,
276+
# not chapters.
277+
#
278+
# latex_use_parts = False
279+
280+
# If true, show page references after internal links.
281+
#
282+
# latex_show_pagerefs = False
283+
284+
# If true, show URL addresses after external links.
285+
#
286+
# latex_show_urls = False
287+
288+
# Documents to append as an appendix to all manuals.
289+
#
290+
# latex_appendices = []
291+
292+
# It false, will not define \strong, \code, itleref, \crossref ... but only
293+
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
294+
# packages.
295+
#
296+
# latex_keep_old_macro_names = True
297+
298+
# If false, no module index is generated.
299+
#
300+
# latex_domain_indices = True
301+
302+
303+
# -- Options for manual page output ---------------------------------------
304+
305+
# One entry per manual page. List of tuples
306+
# (source start file, name, description, authors, manual section).
307+
man_pages = [
308+
(master_doc, 'canopen', u'canopen Documentation',
309+
[author], 1)
310+
]
311+
312+
# If true, show URL addresses after external links.
313+
#
314+
# man_show_urls = False
315+
316+
317+
# -- Options for Texinfo output -------------------------------------------
318+
319+
# Grouping the document tree into Texinfo files. List of tuples
320+
# (source start file, target name, title, author,
321+
# dir menu entry, description, category)
322+
texinfo_documents = [
323+
(master_doc, 'canopen', u'canopen Documentation',
324+
author, 'canopen', 'One line description of project.',
325+
'Miscellaneous'),
326+
]
327+
328+
# Documents to append as an appendix to all manuals.
329+
#
330+
# texinfo_appendices = []
331+
332+
# If false, no module index is generated.
333+
#
334+
# texinfo_domain_indices = True
335+
336+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
337+
#
338+
# texinfo_show_urls = 'footnote'
339+
340+
# If true, do not generate a @detailmenu in the "Top" node's menu.
341+
#
342+
# texinfo_no_detailmenu = False
343+
344+
345+
# Example configuration for intersphinx: refer to the Python standard library.
346+
intersphinx_mapping = {
347+
'python': ('https://docs.python.org/', None),
348+
'can': ('https://python-can.readthedocs.io/en/stable/', None),
349+
}

doc/index.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. canopen documentation master file, created by
2+
sphinx-quickstart on Mon Sep 19 22:15:46 2016.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to canopen's documentation!
7+
===================================
8+
9+
Contents:
10+
11+
.. toctree::
12+
:maxdepth: 2
13+
14+
15+
.. autoclass:: canopen.Network
16+
:members:
17+
18+
Indices and tables
19+
==================
20+
21+
* :ref:`genindex`
22+
* :ref:`modindex`
23+
* :ref:`search`
24+

0 commit comments

Comments
 (0)