[SATYR PATCHv2] python: API documentation

Martin Milata mmilata at redhat.com
Wed Aug 28 23:33:43 UTC 2013


Closes #100.

Signed-off-by: Martin Milata <mmilata at redhat.com>
---
 configure.ac                  |   1 +
 python/Makefile.am            |   2 +
 python/doc/Makefile.am        | 138 ++++++++++++++++++++++++
 python/doc/clustering.rst     |  17 +++
 python/doc/conf.py.in         | 243 ++++++++++++++++++++++++++++++++++++++++++
 python/doc/index.rst          |  25 +++++
 python/doc/report.rst         |  26 +++++
 python/doc/satyr.py           |  12 +++
 python/doc/stacktrace.rst     | 144 +++++++++++++++++++++++++
 python/py_base_frame.c        |   2 +-
 python/py_base_stacktrace.c   |  12 +--
 python/py_base_thread.c       |  18 ++--
 python/py_cluster.c           |  11 +-
 python/py_core_frame.c        |  13 ++-
 python/py_core_stacktrace.c   |  12 +--
 python/py_core_thread.c       |  11 +-
 python/py_gdb_frame.c         |  26 ++---
 python/py_gdb_sharedlib.c     |   6 +-
 python/py_gdb_stacktrace.c    |  50 ++++-----
 python/py_gdb_thread.c        |  26 ++---
 python/py_java_frame.c        |  12 +--
 python/py_java_stacktrace.c   |  12 +--
 python/py_java_thread.c       |  24 ++---
 python/py_koops_frame.c       |  12 +--
 python/py_koops_stacktrace.c  |  19 ++--
 python/py_metrics.c           |  32 +++---
 python/py_operating_system.c  |   6 +-
 python/py_python_frame.c      |  12 +--
 python/py_python_stacktrace.c |  24 ++---
 python/py_report.c            |  17 +--
 python/py_rpm_package.c       |   6 +-
 satyr.spec.in                 |   2 +
 32 files changed, 786 insertions(+), 187 deletions(-)
 create mode 100644 python/doc/Makefile.am
 create mode 100644 python/doc/clustering.rst
 create mode 100644 python/doc/conf.py.in
 create mode 100644 python/doc/index.rst
 create mode 100644 python/doc/report.rst
 create mode 100644 python/doc/satyr.py
 create mode 100644 python/doc/stacktrace.rst

diff --git a/configure.ac b/configure.ac
index d0d4cc5..2b16250 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,6 +105,7 @@ AC_CONFIG_FILES([
 	Makefile
 	lib/Makefile
 	python/Makefile
+	python/doc/Makefile
 	tests/Makefile
 	include/Makefile
 	tests/atlocal
diff --git a/python/Makefile.am b/python/Makefile.am
index a2e95b8..02e6d86 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = . doc
+
 clientexecdir = $(pyexecdir)/satyr
 
 clientexec_PYTHON = \
diff --git a/python/doc/Makefile.am b/python/doc/Makefile.am
new file mode 100644
index 0000000..4dc6221
--- /dev/null
+++ b/python/doc/Makefile.am
@@ -0,0 +1,138 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+BUILDDIR      = _build
+
+# Internal variables.
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(SPHINXOPTS) .
+
+.PHONY: clean-local html-local dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+clean-local:
+	-rm -rf $(BUILDDIR)/*
+	-rm -rf satyr.pyc
+
+html-local:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/satyr-python.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/satyr-python.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/satyr-python"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/satyr-python"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
+conf.py: conf.py.in
+	sed -e "s,\@PACKAGE_STRING\@,$(PACKAGE_STRING),g" $< > $@
+
+EXTRA_DIST = \
+	conf.py.in \
+	satyr.py \
+	index.rst \
+	report.rst \
+	stacktrace.rst \
+	clustering.rst
+
+man3_MANS = _build/man/satyr-python.3
+
+_build/man/satyr-python.3: conf.py man
diff --git a/python/doc/clustering.rst b/python/doc/clustering.rst
new file mode 100644
index 0000000..79220ed
--- /dev/null
+++ b/python/doc/clustering.rst
@@ -0,0 +1,17 @@
+.. _clustering:
+.. currentmodule:: satyr
+
+Clustering
+==========
+
+Distance matrix
+---------------
+
+.. autoclass:: Distances
+   :members:
+
+Dendrogram
+----------
+
+.. autoclass:: Dendrogram
+   :members:
diff --git a/python/doc/conf.py.in b/python/doc/conf.py.in
new file mode 100644
index 0000000..ce3bac8
--- /dev/null
+++ b/python/doc/conf.py.in
@@ -0,0 +1,243 @@
+# -*- coding: utf-8 -*-
+#
+# satyr-python documentation build configuration file, created by
+# sphinx-quickstart on Wed Aug 28 14:56:55 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# 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.
+#sys.path.insert(0, os.path.abspath('../.libs'))
+#XXX: see contents of the file satyr.py
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# 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']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'satyr-python'
+copyright = u'2013, Red Hat, Inc'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '@PACKAGE_STRING@'
+# The full version, including alpha/beta/rc tags.
+release = '@PACKAGE_STRING@'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# 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
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'satyr-pythondoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'satyr-python.tex', u'satyr-python Documentation',
+   u'Red Hat, Inc', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'satyr-python', u'satyr python API',
+     [u'Red Hat, Inc'], 3)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+  ('index', 'satyr-python', u'satyr-python Documentation',
+   u'Red Hat, Inc', 'satyr-python', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
diff --git a/python/doc/index.rst b/python/doc/index.rst
new file mode 100644
index 0000000..1547651
--- /dev/null
+++ b/python/doc/index.rst
@@ -0,0 +1,25 @@
+.. satyr-python documentation master file, created by
+   sphinx-quickstart on Wed Aug 28 14:56:55 2013.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to satyr-python documentation!
+======================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+   
+   report
+   stacktrace
+   clustering
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/python/doc/report.rst b/python/doc/report.rst
new file mode 100644
index 0000000..82d055a
--- /dev/null
+++ b/python/doc/report.rst
@@ -0,0 +1,26 @@
+.. _report:
+.. currentmodule:: satyr
+
+Report
+======
+
+A :class:`Report` object represents a single problem report in the `uReport format <https://github.com/abrt/faf/wiki/uReport>`_.
+
+.. autoclass:: Report
+   :members:
+
+Operating system
+----------------
+
+Data about operating system are stored in the :class:`OperatingSystem` object.
+
+.. autoclass:: OperatingSystem
+   :members:
+
+Package
+-------
+
+The :class:`Report` can contain a list of software packages. Currently, only `RPM <http://www.rpm.org/>`_ packages are supported.
+
+.. autoclass:: RpmPackage
+   :members:
diff --git a/python/doc/satyr.py b/python/doc/satyr.py
new file mode 100644
index 0000000..f79e1ef
--- /dev/null
+++ b/python/doc/satyr.py
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+
+#
+# this file exists for the sole reason of _satyr module appearing as satyr
+# without the underscore in the generated documentation
+#
+
+import os, sys
+
+sys.path.insert(0, os.path.abspath('../.libs'))
+
+from _satyr import *
diff --git a/python/doc/stacktrace.rst b/python/doc/stacktrace.rst
new file mode 100644
index 0000000..806d69d
--- /dev/null
+++ b/python/doc/stacktrace.rst
@@ -0,0 +1,144 @@
+.. _stacktrace:
+.. currentmodule:: satyr
+
+Stacktrace
+==========
+
+Each problem has its own frame, stacktrace and thread type (for problems that
+can have multiple threads).
+
+.. warning::
+   The :class:`GdbFrame`, :class:`GdbThread`, and :class:`GdbStacktrace` have
+   rather limited functionality, cannot be used in reports, and will probably
+   be removed in the future.
+
+Frame classes
+-------------
+
+Stack frame corresponds to a function invocation saved on the stack. All frame
+types are derived from the :class:`BaseFrame`.
+
+BaseFrame
+^^^^^^^^^
+
+.. autoclass:: BaseFrame
+   :members:
+
+CoreFrame
+^^^^^^^^^
+
+.. autoclass:: CoreFrame
+   :members:
+
+JavaFrame
+^^^^^^^^^
+
+.. autoclass:: JavaFrame
+   :members:
+
+KerneloopsFrame
+^^^^^^^^^^^^^^^
+
+.. autoclass:: KerneloopsFrame
+   :members:
+
+PythonFrame
+^^^^^^^^^^^
+
+.. autoclass:: PythonFrame
+   :members:
+
+GdbFrame
+^^^^^^^^
+
+.. autoclass:: GdbFrame
+   :members:
+
+Thread classes
+--------------
+
+Thread classes are defined only for problems that can have multiple thread.
+They all have :class:`BaseThread` as a base class.
+
+BaseThread
+^^^^^^^^^^
+
+.. autoclass:: BaseThread
+   :members:
+
+CoreThread
+^^^^^^^^^^
+
+.. autoclass:: CoreThread
+   :members:
+
+JavaThread
+^^^^^^^^^^
+
+.. autoclass:: JavaThread
+   :members:
+
+GdbThread
+^^^^^^^^^^
+
+.. autoclass:: GdbThread
+   :members:
+
+Stacktrace classes
+------------------
+
+Single threaded stacktraces have :class:`SingleThreadStacktrace` as their base
+class, which is in turn derived from :class:`BaseThread`. This means that
+:class:`SingleThreadStacktrace` can be treated as a thread:
+
+ * :class:`Kerneloops`
+ * :class:`PythonStacktrace`
+
+Stacktrace types with the possibility of multiple threads are derived from
+:class:`MultiThreadStacktrace`:
+
+ * :class:`CoreStacktrace`
+ * :class:`JavaStacktrace`
+ * :class:`GdbStacktrace`
+
+SingleThreadStacktrace
+^^^^^^^^^^^^^^^^^^^^^^
+
+.. autoclass:: SingleThreadStacktrace
+   :members:
+
+MultiThreadStacktrace
+^^^^^^^^^^^^^^^^^^^^^
+
+.. autoclass:: MultiThreadStacktrace
+   :members:
+
+CoreStacktrace
+^^^^^^^^^^^^^^
+
+.. autoclass:: CoreStacktrace
+   :members:
+
+JavaStacktrace
+^^^^^^^^^^^^^^
+
+.. autoclass:: JavaStacktrace
+   :members:
+
+Kerneloops
+^^^^^^^^^^
+
+.. autoclass:: Kerneloops
+   :members:
+
+PythonStacktrace
+^^^^^^^^^^^^^^^^
+
+.. autoclass:: PythonStacktrace
+   :members:
+
+GdbStacktrace
+^^^^^^^^^^^^^
+
+.. autoclass:: GdbStacktrace
+   :members:
diff --git a/python/py_base_frame.c b/python/py_base_frame.c
index 7c614c7..d6fee90 100644
--- a/python/py_base_frame.c
+++ b/python/py_base_frame.c
@@ -27,7 +27,7 @@
 
 #define frame_doc "satyr.BaseFrame - base class for call frames"
 
-#define f_short_string_doc "Usage: frame.short_string()\n" \
+#define f_short_string_doc "Usage: frame.short_string()\n\n" \
                            "Returns: string - brief textual representation of the frame"
 
 static PyMethodDef
diff --git a/python/py_base_stacktrace.c b/python/py_base_stacktrace.c
index 8a8c6f0..4da5902 100644
--- a/python/py_base_stacktrace.c
+++ b/python/py_base_stacktrace.c
@@ -27,16 +27,16 @@
 #define single_stacktrace_doc "satyr.SingleThreadStacktrace - base class for stacktrace with single thread"
 #define multi_stacktrace_doc "satyr.MultiThreadStacktrace - base class for stacktrace with multiple threads"
 
-#define to_short_text_doc "Usage: stacktrace.to_short_text([max_frames])\n" \
+#define to_short_text_doc "Usage: stacktrace.to_short_text([max_frames])\n\n" \
                           "Returns short text representation of the stacktrace. If max_frames is\n" \
-                          "specified, the result includes only that much topmost frames.\n"
+                          "specified, the result includes only that much topmost frames."
 
-#define get_bthash_doc "Usage: stacktrace.get_bthash([flags])\n" \
-                       "Returns: string - hash of the stacktrace\n" \
+#define get_bthash_doc "Usage: stacktrace.get_bthash([flags])\n\n" \
+                       "Returns: string - hash of the stacktrace\n\n" \
                        "flags: integer - bitwise sum of flags (BTHASH_NORMAL, BTHASH_NOHASH)"
 
-#define from_json_doc "Usage: SomeStacktrace.from_json(json_string) (class method)\n" \
-                      "Returns: stacktrace (of SomeStacktrace class) deserialized from json_string\n" \
+#define from_json_doc "Usage: SomeStacktrace.from_json(json_string) (class method)\n\n" \
+                      "Returns: stacktrace (of SomeStacktrace class) deserialized from json_string\n\n" \
                       "json_string: string - json input"
 
 #define crash_thread_doc "Reference to the thread that caused the crash, if known"
diff --git a/python/py_base_thread.c b/python/py_base_thread.c
index ff2eab7..f4a68b5 100644
--- a/python/py_base_thread.c
+++ b/python/py_base_thread.c
@@ -28,17 +28,17 @@
 #define thread_doc "satyr.BaseThread - base class for threads"
 #define frames_doc "A list containing objects representing frames in a thread."
 
-#define distance_doc "Usage: thread.distance(other, dist_type=DISTANCE_LEVENSHTEIN)\n"\
-                     "other: other thread\n"\
-                     "dist_type (optional): one of DISTANCE_LEVENSHTEIN, DISTANCE_JARO_WINKLER,\n"\
-                     "                      DISTANCE_JACCARD or DISTANCE_DAMERAU_LEVENSHTEIN\n"\
+#define distance_doc "Usage: thread.distance(other, dist_type=DISTANCE_LEVENSHTEIN)\n\n"\
+                     "other: other thread\n\n"\
+                     "dist_type (optional): one of DISTANCE_LEVENSHTEIN, DISTANCE_JARO_WINKLER, "\
+                     "DISTANCE_JACCARD or DISTANCE_DAMERAU_LEVENSHTEIN\n\n"\
                      "Returns: positive float - distance between the two threads"
 
-#define get_duphash_doc "Usage: thread.get_duphash(frames=0, flags=DUPHASH_NORMAL, prefix='')\n"\
-                        "Returns: string - thread's duplication hash\n"\
-                        "frames: integer - number of frames to use (default 0 means use all)\n"\
-                        "flags: integer - bitwise sum of flags (DUPHASH_NORMAL, DUPHASH_NOHASH,\n"\
-                        "                 DUPHASH_NONORMALIZE)\n"\
+#define get_duphash_doc "Usage: thread.get_duphash(frames=0, flags=DUPHASH_NORMAL, prefix='')\n\n"\
+                        "Returns: string - thread's duplication hash\n\n"\
+                        "frames: integer - number of frames to use (default 0 means use all)\n\n"\
+                        "flags: integer - bitwise sum of flags (DUPHASH_NORMAL, DUPHASH_NOHASH, \n"\
+                        "DUPHASH_NONORMALIZE)\n\n"\
                         "prefix: string - string to be prepended in front of the text before hashing"
 
 static PyMethodDef
diff --git a/python/py_cluster.c b/python/py_cluster.c
index 3050a71..21942d8 100644
--- a/python/py_cluster.c
+++ b/python/py_cluster.c
@@ -3,18 +3,19 @@
 #include "strbuf.h"
 #include "cluster.h"
 
-#define dendrogram_doc "satyr.Dendrogram - a dendrogram created by clustering algorithm\n"
+#define dendrogram_doc "satyr.Dendrogram - a dendrogram created by clustering algorithm\n\n" \
+                       "Usage: satyr.Dendrogram(distances) - creates new dendrogram from a distance matrix"
 
-#define de_get_size_doc "Usage: dendrogram.get_size()\n" \
+#define de_get_size_doc "Usage: dendrogram.get_size()\n\n" \
                         "Returns: integer - number of objects in the dendrogram"
 
-#define de_get_object_doc "Usage: dendrogram.get_object(i)\n" \
+#define de_get_object_doc "Usage: dendrogram.get_object(i)\n\n" \
                           "Returns: integer - index of the object at position i"
 
-#define de_get_merge_level_doc "Usage: dendrogram.get_merge_level(i)\n" \
+#define de_get_merge_level_doc "Usage: dendrogram.get_merge_level(i)\n\n" \
                                "Returns: float - merge level between clusters at positions i and i + 1"
 
-#define de_cut_doc "Usage: dendrogram.cut(level, min_size)\n" \
+#define de_cut_doc "Usage: dendrogram.cut(level, min_size)\n\n" \
                    "Returns: list of clusters (lists of objects) which have at least min_size objects\n" \
                    "and which were merged at most at the specified distance"
 
diff --git a/python/py_core_frame.c b/python/py_core_frame.c
index 7abeee8..6fa32d0 100644
--- a/python/py_core_frame.c
+++ b/python/py_core_frame.c
@@ -25,14 +25,13 @@
 #include "utils.h"
 #include "core/frame.h"
 
-#define frame_doc "satyr.CoreFrame - class representing a frame in a native executable\n" \
-                  "Usage:\n" \
-                  "satyr.CoreFrame() - creates an empty frame"
+#define frame_doc "satyr.CoreFrame - class representing a frame in a native executable\n\n" \
+                  "Usage: satyr.CoreFrame() - creates an empty frame"
 
-#define f_dup_doc "Usage: frame.dup()\n" \
-                  "Returns: satyr.CoreFrame - a new clone of frame\n" \
+#define f_dup_doc "Usage: frame.dup()\n\n" \
+                  "Returns: satyr.CoreFrame - a new clone of the frame\n\n" \
                   "Clones the frame object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 
 static PyMethodDef
@@ -67,7 +66,7 @@ frame_getset[] =
     SR_ATTRIBUTE_STRING(function_name,      "Function name (string)"                            ),
     SR_ATTRIBUTE_STRING(file_name,          "Name of the executable or shared library (string)" ),
     SR_ATTRIBUTE_STRING(fingerprint,        "Fingerprint of the current function (string)"      ),
-    SR_ATTRIBUTE_BOOL  (fingerprint_hashed, "True if fingerprint is already hasheed (bool)"     ),
+    SR_ATTRIBUTE_BOOL  (fingerprint_hashed, "True if fingerprint is already hashed (bool)"      ),
     { NULL }
 };
 
diff --git a/python/py_core_stacktrace.c b/python/py_core_stacktrace.c
index 936611b..b7d5dd5 100644
--- a/python/py_core_stacktrace.c
+++ b/python/py_core_stacktrace.c
@@ -27,15 +27,15 @@
 #include "core/thread.h"
 #include "stacktrace.h"
 
-#define stacktrace_doc "satyr.CoreStacktrace - class representing a core stacktrace\n" \
-                       "Usage:\n" \
-                       "satyr.CoreStacktrace() - creates an empty stacktrace\n" \
+#define stacktrace_doc "satyr.CoreStacktrace - class representing a core stacktrace\n\n" \
+                       "Usage:\n\n" \
+                       "satyr.CoreStacktrace() - creates an empty stacktrace\n\n" \
                        "satyr.CoreStacktrace(json) - creates stacktrace object from JSON string"
 
-#define b_dup_doc "Usage: stacktrace.dup()\n" \
-                  "Returns: satyr.CoreStacktrace - a new clone of core stacktrace\n" \
+#define b_dup_doc "Usage: stacktrace.dup()\n\n" \
+                  "Returns: satyr.CoreStacktrace - a new clone of core stacktrace\n\n" \
                   "Clones the stacktrace object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 static PyMethodDef
 core_stacktrace_methods[] =
diff --git a/python/py_core_thread.c b/python/py_core_thread.c
index 2d27f9f..58b0a1c 100644
--- a/python/py_core_thread.c
+++ b/python/py_core_thread.c
@@ -26,14 +26,13 @@
 #include "core/frame.h"
 #include "utils.h"
 
-#define thread_doc "satyr.CoreThread - class representing a thread in a stacktrace\n" \
-                   "Usage:\n" \
-                   "satyr.CoreThread() - creates an empty thread"
+#define thread_doc "satyr.CoreThread - class representing a thread in a stacktrace\n\n" \
+                   "Usage: satyr.CoreThread() - creates an empty thread"
 
-#define t_dup_doc "Usage: thread.dup()\n" \
-                  "Returns: satyr.CoreThread - a new clone of thread\n" \
+#define t_dup_doc "Usage: thread.dup()\n\n" \
+                  "Returns: satyr.CoreThread - a new clone of thread\n\n" \
                   "Clones the thread object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 static PyMethodDef
 core_thread_methods[] =
diff --git a/python/py_gdb_frame.c b/python/py_gdb_frame.c
index 839c8f0..c9d923e 100644
--- a/python/py_gdb_frame.c
+++ b/python/py_gdb_frame.c
@@ -28,26 +28,26 @@
 #include "utils.h"
 #include "gdb/frame.h"
 
-#define frame_doc "satyr.GdbFrame - class representing a frame in a thread\n" \
-                  "Usage:\n" \
-                  "satyr.GdbFrame() - creates an empty frame\n" \
+#define frame_doc "satyr.GdbFrame - class representing a frame in a thread\n\n" \
+                  "Usage:\n\n" \
+                  "satyr.GdbFrame() - creates an empty frame\n\n" \
                   "satyr.GdbFrame(str) - parses str and fills the frame object"
 
-#define f_dup_doc "Usage: frame.dup()\n" \
-                  "Returns: satyr.GdbFrame - a new clone of frame\n" \
+#define f_dup_doc "Usage: frame.dup()\n\n" \
+                  "Returns: satyr.GdbFrame - a new clone of the frame\n\n" \
                   "Clones the frame object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
-#define f_calls_func_doc "Usage: frame.calls_func(name)\n" \
-                         "name: string - function name\n" \
-                         "Returns: integer - 0 = False, 1 = True\n" \
+#define f_calls_func_doc "Usage: frame.calls_func(name)\n\n" \
+                         "name: string - function name\n\n" \
+                         "Returns: integer - 0 = False, 1 = True\n\n" \
                          "Checks whether the frame represents a call to " \
                          "a function with given name."
 
-#define f_calls_func_in_file_doc "Usage: frame.calls_func_in_file(name, filename)\n" \
-                                 "name: string - function name\n" \
-                                 "filename: string - file name\n" \
-                                 "Returns: integer - 0 = False, 1 = True\n" \
+#define f_calls_func_in_file_doc "Usage: frame.calls_func_in_file(name, filename)\n\n" \
+                                 "name: string - function name\n\n" \
+                                 "filename: string - file name\n\n" \
+                                 "Returns: integer - 0 = False, 1 = True\n\n" \
                                  "Checks whether the frame represents a call to " \
                                  "a function with given name from a given file."
 
diff --git a/python/py_gdb_sharedlib.c b/python/py_gdb_sharedlib.c
index 03d937a..1aec06c 100644
--- a/python/py_gdb_sharedlib.c
+++ b/python/py_gdb_sharedlib.c
@@ -5,9 +5,9 @@
 
 #define sharedlib_doc "satyr.GdbSharedlib - class representing a shared library loaded at the moment of crash"
 
-#define s_symbols_doc "Symbol state (satyr.SYMS_OK / satyr.SYMS_NOT_FOUND / satyr.SYMS_WRONG)\n"         \
-                      "SYMS_OK:        Debug symbols for the library were loaded successfully.\n"        \
-                      "SYMS_WRONG:     Debug symbols for the library were present, but did not match.\n" \
+#define s_symbols_doc "Symbol state (satyr.SYMS_OK / satyr.SYMS_NOT_FOUND / satyr.SYMS_WRONG)\n\n"         \
+                      "SYMS_OK:        Debug symbols for the library were loaded successfully.\n\n"        \
+                      "SYMS_WRONG:     Debug symbols for the library were present, but did not match.\n\n" \
                       "SYMS_NOT_FOUND: Debug symbols for the library were not found."
 
 /* See python/py_common.h and python/py_gdb_frame.c for generic getters/setters documentation. */
diff --git a/python/py_gdb_stacktrace.c b/python/py_gdb_stacktrace.c
index 2de69c9..c799e06 100644
--- a/python/py_gdb_stacktrace.c
+++ b/python/py_gdb_stacktrace.c
@@ -11,57 +11,57 @@
 #include "location.h"
 #include "normalize.h"
 
-#define stacktrace_doc "satyr.GdbStacktrace - class representing a stacktrace\n" \
-                      "Usage:\n" \
-                      "satyr.GdbStacktrace() - creates an empty stacktrace\n" \
+#define stacktrace_doc "satyr.GdbStacktrace - class representing a stacktrace\n\n" \
+                      "Usage:\n\n" \
+                      "satyr.GdbStacktrace() - creates an empty stacktrace\n\n" \
                       "satyr.GdbStacktrace(str) - parses str and fills the stacktrace object"
 
-#define b_dup_doc "Usage: stacktrace.dup()\n" \
-                  "Returns: satyr.GdbStacktrace - a new clone of stacktrace\n" \
+#define b_dup_doc "Usage: stacktrace.dup()\n\n" \
+                  "Returns: satyr.GdbStacktrace - a new clone of stacktrace\n\n" \
                   "Clones the stacktrace object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
-#define b_find_crash_frame_doc "Usage: stacktrace.find_crash_frame()\n" \
-                               "Returns: satyr.Frame - crash frame\n" \
+#define b_find_crash_frame_doc "Usage: stacktrace.find_crash_frame()\n\n" \
+                               "Returns: satyr.Frame - crash frame\n\n" \
                                "Finds crash frame in the stacktrace. Also sets the " \
                                "stacktrace.crashframe field."
 
-#define b_limit_frame_depth_doc "Usage: stacktrace.limit_frame_depth(N)\n" \
-                                "N: positive integer - frame depth\n" \
+#define b_limit_frame_depth_doc "Usage: stacktrace.limit_frame_depth(N)\n\n" \
+                                "N: positive integer - frame depth\n\n" \
                                 "Crops all threads to only contain first N frames."
 
-#define b_quality_simple_doc "Usage: stacktrace.quality_simple()\n" \
-                             "Returns: float - 0..1, stacktrace quality\n" \
+#define b_quality_simple_doc "Usage: stacktrace.quality_simple()\n\n" \
+                             "Returns: float - 0..1, stacktrace quality\n\n" \
                              "Computes the quality from stacktrace itself."
 
-#define b_quality_complex_doc "Usage: stacktrace.quality_complex()\n" \
-                              "Returns: float - 0..1, stacktrace quality\n" \
+#define b_quality_complex_doc "Usage: stacktrace.quality_complex()\n\n" \
+                              "Returns: float - 0..1, stacktrace quality\n\n" \
                               "Computes the quality from stacktrace, crash thread and " \
                               "frames around the crash."
 
-#define b_find_address_doc "Usage: stacktrace.find_address(address)\n" \
-                           "address: long - address to find" \
-                           "Returns: satyr.Sharedlib object or None if not found\n" \
+#define b_find_address_doc "Usage: stacktrace.find_address(address)\n\n" \
+                           "address: long - address to find\n\n" \
+                           "Returns: satyr.Sharedlib object or None if not found\n\n" \
                            "Looks whether the given address belongs to a shared library."
 
-#define b_set_libnames_doc "Usage: stacktrace.set_libnames()\n" \
+#define b_set_libnames_doc "Usage: stacktrace.set_libnames()\n\n" \
                            "Sets library names according to sharedlibs data."
 
-#define b_normalize_doc "Usage: stacktrace.normalize()\n" \
+#define b_normalize_doc "Usage: stacktrace.normalize()\n\n" \
                         "Normalizes all threads in the stacktrace."
 
-#define b_to_short_text "Usage: stacktrace.to_short_text([max_frames])\n" \
+#define b_to_short_text "Usage: stacktrace.to_short_text([max_frames])\n\n" \
                         "Returns short text representation of the crash thread. If max_frames is\n" \
-                        "specified, the result includes only that much topmost frames.\n"
+                        "specified, the result includes only that much topmost frames."
 
-#define b_crashframe_doc (char *)"Readonly. By default the field contains None. After " \
-                         "calling the find_crash_frame method, a reference to " \
+#define b_crashframe_doc (char *)"Readonly. By default the field contains None. After\n" \
+                         "calling the find_crash_frame method, a reference to\n" \
                          "satyr.Frame object is stored into the field."
 
-#define b_threads_doc (char *)"A list containing the satyr.Thread objects " \
+#define b_threads_doc (char *)"A list containing the satyr.Thread objects\n" \
                       "representing threads in the stacktrace."
 
-#define b_libs_doc (char *)"A list containing the satyr.Sharedlib objects " \
+#define b_libs_doc (char *)"A list containing the satyr.Sharedlib objects\n" \
                    "representing shared libraries loaded at the moment of crash."
 
 static PyMethodDef
diff --git a/python/py_gdb_thread.c b/python/py_gdb_thread.c
index 4891375..974d498 100644
--- a/python/py_gdb_thread.c
+++ b/python/py_gdb_thread.c
@@ -7,29 +7,29 @@
 #include "gdb/frame.h"
 #include "location.h"
 
-#define thread_doc "satyr.GdbThread - class representing a thread in a stacktrace\n" \
-                   "Usage:\n" \
-                   "satyr.GdbThread() - creates an empty thread\n" \
-                   "satyr.GdbThread(str) - parses str and fills the thread object\n" \
+#define thread_doc "satyr.GdbThread - class representing a thread in a stacktrace\n\n" \
+                   "Usage:\n\n" \
+                   "satyr.GdbThread() - creates an empty thread\n\n" \
+                   "satyr.GdbThread(str) - parses str and fills the thread object\n\n" \
                    "satyr.GdbThread(str, only_funs=True) - parses list of function names"
 
-#define t_dup_doc "Usage: thread.dup()\n" \
-                  "Returns: satyr.GdbThread - a new clone of thread\n" \
+#define t_dup_doc "Usage: thread.dup()\n\n" \
+                  "Returns: satyr.GdbThread - a new clone of thread\n\n" \
                   "Clones the thread object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
-#define t_quality_counts_doc "Usage: thread.quality_counts()\n" \
+#define t_quality_counts_doc "Usage: thread.quality_counts()\n\n" \
                              "Returns: tuple (ok, all) - ok representing number of " \
-                             "'good' frames, all representing total number of frames\n" \
+                             "'good' frames, all representing total number of frames\n\n" \
                              "Counts the number of 'good' frames and the number of all " \
                              "frames. 'Good' means the function name is known (not just '?\?')."
 
-#define t_quality_doc "Usage: thread.quality()\n" \
-                      "Returns: float - 0..1, thread quality\n" \
+#define t_quality_doc "Usage: thread.quality()\n\n" \
+                      "Returns: float - 0..1, thread quality\n\n" \
                       "Computes the ratio #good / #all. See quality_counts method for more."
 
-#define t_format_funs_doc "Usage: thread.format_funs()\n" \
-                      "Returns: string"
+#define t_format_funs_doc "Usage: thread.format_funs()\n\n" \
+                          "Returns: string"
 
 static PyMethodDef
 gdb_thread_methods[] =
diff --git a/python/py_java_frame.c b/python/py_java_frame.c
index 602cf73..ffb64ac 100644
--- a/python/py_java_frame.c
+++ b/python/py_java_frame.c
@@ -25,15 +25,15 @@
 #include "utils.h"
 #include "java/frame.h"
 
-#define frame_doc "satyr.JavaFrame - class representing a java frame\n" \
-                  "Usage:\n" \
-                  "satyr.JavaFrame() - creates an empty frame\n" \
+#define frame_doc "satyr.JavaFrame - class representing a java frame\n\n" \
+                  "Usage:\n\n" \
+                  "satyr.JavaFrame() - creates an empty frame\n\n" \
                   "satyr.JavaFrame(str) - parses str and fills the frame object"
 
-#define f_dup_doc "Usage: frame.dup()\n" \
-                  "Returns: satyr.JavaFrame - a new clone of frame\n" \
+#define f_dup_doc "Usage: frame.dup()\n\n" \
+                  "Returns: satyr.JavaFrame - a new clone of frame\n\n" \
                   "Clones the frame object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 
 static PyMethodDef
diff --git a/python/py_java_stacktrace.c b/python/py_java_stacktrace.c
index c175692..0983b51 100644
--- a/python/py_java_stacktrace.c
+++ b/python/py_java_stacktrace.c
@@ -8,15 +8,15 @@
 #include "location.h"
 #include "stacktrace.h"
 
-#define stacktrace_doc "satyr.JavaStacktrace - class representing a java stacktrace\n" \
-                      "Usage:\n" \
-                      "satyr.JavaStacktrace() - creates an empty stacktrace\n" \
+#define stacktrace_doc "satyr.JavaStacktrace - class representing a java stacktrace\n\n" \
+                      "Usage:\n\n" \
+                      "satyr.JavaStacktrace() - creates an empty stacktrace\n\n" \
                       "satyr.JavaStacktrace(str) - parses str and fills the stacktrace object"
 
-#define b_dup_doc "Usage: stacktrace.dup()\n" \
-                  "Returns: satyr.JavaStacktrace - a new clone of java stacktrace\n" \
+#define b_dup_doc "Usage: stacktrace.dup()\n\n" \
+                  "Returns: satyr.JavaStacktrace - a new clone of java stacktrace\n\n" \
                   "Clones the stacktrace object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 static PyMethodDef
 java_stacktrace_methods[] =
diff --git a/python/py_java_thread.c b/python/py_java_thread.c
index 73d17ab..039709e 100644
--- a/python/py_java_thread.c
+++ b/python/py_java_thread.c
@@ -8,28 +8,28 @@
 #include "location.h"
 #include "utils.h"
 
-#define thread_doc "satyr.JavaThread - class representing a thread in a stacktrace\n" \
-                   "Usage:\n" \
-                   "satyr.JavaThread() - creates an empty thread\n" \
+#define thread_doc "satyr.JavaThread - class representing a thread in a stacktrace\n\n" \
+                   "Usage:\n\n" \
+                   "satyr.JavaThread() - creates an empty thread\n\n" \
                    "satyr.JavaThread(str) - parses str and fills the thread object"
 
-#define t_dup_doc "Usage: thread.dup()\n" \
-                  "Returns: satyr.JavaThread - a new clone of thread\n" \
+#define t_dup_doc "Usage: thread.dup()\n\n" \
+                  "Returns: satyr.JavaThread - a new clone of thread\n\n" \
                   "Clones the thread object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
-#define t_quality_counts_doc "Usage: thread.quality_counts()\n" \
+#define t_quality_counts_doc "Usage: thread.quality_counts()\n\n" \
                              "Returns: tuple (ok, all) - ok representing number of " \
-                             "'good' frames, all representing total number of frames\n" \
+                             "'good' frames, all representing total number of frames\n\n" \
                              "Counts the number of 'good' frames and the number of all " \
                              "frames. 'Good' means the function name is known (not just '?\?')."
 
-#define t_quality_doc "Usage: thread.quality()\n" \
-                      "Returns: float - 0..1, thread quality\n" \
+#define t_quality_doc "Usage: thread.quality()\n\n" \
+                      "Returns: float - 0..1, thread quality\n\n" \
                       "Computes the ratio #good / #all. See quality_counts method for more."
 
-#define t_format_funs_doc "Usage: thread.format_funs()\n" \
-                      "Returns: string"
+#define t_format_funs_doc "Usage: thread.format_funs()\n\n" \
+                          "Returns: string"
 
 static PyMethodDef
 java_thread_methods[] =
diff --git a/python/py_koops_frame.c b/python/py_koops_frame.c
index eae74e6..0eec8cc 100644
--- a/python/py_koops_frame.c
+++ b/python/py_koops_frame.c
@@ -28,15 +28,15 @@
 #include "utils.h"
 #include "koops/frame.h"
 
-#define frame_doc "satyr.KerneloopsFrame - class representing a frame in a kerneloops\n" \
-                  "Usage:\n" \
-                  "satyr.KerneloopsFrame() - creates an empty frame\n" \
+#define frame_doc "satyr.KerneloopsFrame - class representing a frame in a kerneloops\n\n" \
+                  "Usage:\n\n" \
+                  "satyr.KerneloopsFrame() - creates an empty frame\n\n" \
                   "satyr.KerneloopsFrame(str) - parses str and fills the frame object"
 
-#define f_dup_doc "Usage: frame.dup()\n" \
-                  "Returns: satyr.KerneloopsFrame - a new clone of frame\n" \
+#define f_dup_doc "Usage: frame.dup()\n\n" \
+                  "Returns: satyr.KerneloopsFrame - a new clone of frame\n\n" \
                   "Clones the frame object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 
 static PyMethodDef
diff --git a/python/py_koops_stacktrace.c b/python/py_koops_stacktrace.c
index 7b53eec..6db3e4a 100644
--- a/python/py_koops_stacktrace.c
+++ b/python/py_koops_stacktrace.c
@@ -10,24 +10,19 @@
 #include "stacktrace.h"
 #include "internal_utils.h"
 
-#define stacktrace_doc "satyr.Kerneloops - class representing a kerneloops stacktrace\n" \
-                      "Usage:\n" \
-                      "satyr.Kerneloops() - creates an empty kerneloops stacktrace\n" \
+#define stacktrace_doc "satyr.Kerneloops - class representing a kerneloops stacktrace\n\n" \
+                      "Usage:\n\n" \
+                      "satyr.Kerneloops() - creates an empty kerneloops stacktrace\n\n" \
                       "satyr.Kerneloops(str) - parses str and fills the kerneloops stacktrace object"
 
-#define b_dup_doc "Usage: stacktrace.dup()\n" \
-                  "Returns: satyr.Kerneloops - a new clone of kerneloops stacktrace\n" \
+#define b_dup_doc "Usage: stacktrace.dup()\n\n" \
+                  "Returns: satyr.Kerneloops - a new clone of kerneloops stacktrace\n\n" \
                   "Clones the kerneloops object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
-#define b_normalize_doc "Usage: stacktrace.normalize()\n" \
+#define b_normalize_doc "Usage: stacktrace.normalize()\n\n" \
                         "Normalizes the stacktrace."
 
-#define b_to_short_text "Usage: stacktrace.to_short_text([max_frames])\n" \
-                        "Returns short text representation of the stacktrace. If max_frames is\n" \
-                        "specified, the result includes only that much topmost frames.\n"
-
-#define b_frames_doc "A list containing frames"
 #define b_taint_flags_doc "Dictionary of kernel taint flags. Keys are the flag names,\n" \
                           "values are booleans indicating whether the flag is set."
 #define b_modules_doc "Modules loaded at the time of the event (list of strings)"
diff --git a/python/py_metrics.c b/python/py_metrics.c
index c43fd02..4740272 100644
--- a/python/py_metrics.c
+++ b/python/py_metrics.c
@@ -3,27 +3,27 @@
 #include "strbuf.h"
 #include "distance.h"
 
-#define distances_doc "satyr.Distances - class representing distances between objects\n" \
-                      "Usage:\n" \
-                      "satyr.Distances(m, n) - creates an m-by-n distance matrix\n" \
-                      "satyr.Distances([threads], m, dist_type=DISTANCE_LEVENSHTEIN) \n"\
-                      "        - compares first m threads with others\n" \
-                      "dist_type (optional): DISTANCE_LEVENSHTEIN, DISTANCE_JACCARD \n"\
-                      "                      or DISTANCE_DAMERAU_LEVENSHTEIN\n"
-
-#define di_get_size_doc "Usage: distances.get_size()\n" \
-                       "Returns: (m, n) - size of the distance matrix"
-
-#define di_get_distance_doc "Usage: distances.get_distance(i, j)\n" \
+#define distances_doc "satyr.Distances - class representing distances between objects\n\n" \
+                      "Usage:\n\n" \
+                      "satyr.Distances(m, n) - creates an m-by-n distance matrix\n\n" \
+                      "satyr.Distances([threads], m, dist_type=DISTANCE_LEVENSHTEIN) "\
+                      "- compares first m threads with others\n\n" \
+                      "dist_type (optional): DISTANCE_LEVENSHTEIN, DISTANCE_JACCARD "\
+                      "or DISTANCE_DAMERAU_LEVENSHTEIN"
+
+#define di_get_size_doc "Usage: distances.get_size()\n\n" \
+                        "Returns: (m, n) - size of the distance matrix"
+
+#define di_get_distance_doc "Usage: distances.get_distance(i, j)\n\n" \
                             "Returns: positive float - distance between objects i and j"
 
-#define di_set_distance_doc "Usage: distances.set_distance(i, j, d)\n" \
+#define di_set_distance_doc "Usage: distances.set_distance(i, j, d)\n\n" \
                             "Sets distance between objects i and j to d"
 
-#define di_dup_doc "Usage: distances.dup()\n" \
-                   "Returns: satyr.Distances - a new clone of the distances\n" \
+#define di_dup_doc "Usage: distances.dup()\n\n" \
+                   "Returns: satyr.Distances - a new clone of the distances\n\n" \
                    "Clones the distances object. All new structures are independent\n" \
-                   "on the original object."
+                   "of the original object."
 
 static PyMethodDef
 distances_methods[] =
diff --git a/python/py_operating_system.c b/python/py_operating_system.c
index 0974d7a..666f870 100644
--- a/python/py_operating_system.c
+++ b/python/py_operating_system.c
@@ -24,9 +24,9 @@
 #include "operating_system.h"
 #include "strbuf.h"
 
-#define operating_system_doc "satyr.OperatingSystem - describes an operating system\n" \
-                             "Usage:\n" \
-                             "satyr.OperatingSystem() - creates an empty operating system object\n" \
+#define operating_system_doc "satyr.OperatingSystem - describes an operating system\n\n" \
+                             "Usage:\n\n" \
+                             "satyr.OperatingSystem() - creates an empty operating system object\n\n" \
                              "satyr.OperatingSystem(name, version, arch) - creates an operating system\n" \
                              "object with given properties (all arguments are strings or None)"
 
diff --git a/python/py_python_frame.c b/python/py_python_frame.c
index 4ff160a..1f2623d 100644
--- a/python/py_python_frame.c
+++ b/python/py_python_frame.c
@@ -25,15 +25,15 @@
 #include "utils.h"
 #include "python/frame.h"
 
-#define frame_doc "satyr.PythonFrame - class representing a python frame\n" \
-                  "Usage:\n" \
-                  "satyr.PythonFrame() - creates an empty frame\n" \
+#define frame_doc "satyr.PythonFrame - class representing a python frame\n\n" \
+                  "Usage:\n\n" \
+                  "satyr.PythonFrame() - creates an empty frame\n\n" \
                   "satyr.PythonFrame(str) - parses str and fills the frame object"
 
-#define f_dup_doc "Usage: frame.dup()\n" \
-                  "Returns: satyr.PythonFrame - a new clone of frame\n" \
+#define f_dup_doc "Usage: frame.dup()\n\n" \
+                  "Returns: satyr.PythonFrame - a new clone of frame\n\n" \
                   "Clones the frame object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
 
 static PyMethodDef
diff --git a/python/py_python_stacktrace.c b/python/py_python_stacktrace.c
index 65cba81..5b59c10 100644
--- a/python/py_python_stacktrace.c
+++ b/python/py_python_stacktrace.c
@@ -10,27 +10,19 @@
 #include "normalize.h"
 #include "stacktrace.h"
 
-#define stacktrace_doc "satyr.PythonStacktrace - class representing a python stacktrace\n" \
-                      "Usage:\n" \
-                      "satyr.PythonStacktrace() - creates an empty python stacktrace\n" \
-                      "satyr.PythonStacktrace(str) - parses str and fills the python stacktrace object"
+#define stacktrace_doc "satyr.PythonStacktrace - class representing a python stacktrace\n\n" \
+                       "Usage:\n\n" \
+                       "satyr.PythonStacktrace() - creates an empty python stacktrace\n\n" \
+                       "satyr.PythonStacktrace(str) - parses str and fills the python stacktrace object"
 
-#define f_dup_doc "Usage: stacktrace.dup()\n" \
-                  "Returns: satyr.PythonStacktrace - a new clone of python stacktrace\n" \
+#define f_dup_doc "Usage: stacktrace.dup()\n\n" \
+                  "Returns: satyr.PythonStacktrace - a new clone of python stacktrace\n\n" \
                   "Clones the PythonStacktrace object. All new structures are independent " \
-                  "on the original object."
+                  "of the original object."
 
-#define f_to_short_text "Usage: stacktrace.to_short_text([max_frames])\n" \
-                        "Returns short text representation of the stacktrace. If max_frames is\n" \
-                        "specified, the result includes only that much topmost frames.\n"
-
-#define f_normalize_doc "Usage: stacktrace.normalize()\n" \
+#define f_normalize_doc "Usage: stacktrace.normalize()\n\n" \
                         "Normalizes the stacktrace."
 
-#define f_frames_doc "A list containing frames"
-#define f_get_modules_doc "Usage: stacktrace.get_modules()\n" \
-                        "Returns: list of strings - loaded modules at time of the event"
-
 
 static PyMethodDef
 python_stacktrace_methods[] =
diff --git a/python/py_report.c b/python/py_report.c
index 678d661..d314027 100644
--- a/python/py_report.c
+++ b/python/py_report.c
@@ -34,12 +34,12 @@
 #include "strbuf.h"
 #include "rpm.h"
 
-#define report_doc "satyr.Report - report containing all data relevant to a software problem\n" \
-                   "Usage:\n" \
-                   "satyr.Report() - creates an empty report object\n" \
+#define report_doc "satyr.Report - report containing all data relevant to a software problem\n\n" \
+                   "Usage:\n\n" \
+                   "satyr.Report() - creates an empty report object\n\n" \
                    "satyr.Report(json_string) - creates a report from its JSON representation"
 
-#define to_json_doc "Usage: report.to_json()\n" \
+#define to_json_doc "Usage: report.to_json()\n\n" \
                     "Returns: string - the report serialized as JSON"
 
 /* See python/py_common.h and python/py_gdb_frame.c for generic getters/setters documentation. */
@@ -70,9 +70,12 @@ report_getset[] =
 static PyMemberDef
 report_members[] =
 {
-    { (char*)"stacktrace", T_OBJECT_EX, offsetof(struct sr_py_report, stacktrace), 0, (char*)"Problem stacktrace" },
-    { (char*)"operating_system", T_OBJECT_EX, offsetof(struct sr_py_report, operating_system), 0, (char *)"Operating system" },
-    { (char*)"packages", T_OBJECT_EX, offsetof(struct sr_py_report, packages), 0, (char *)"List of packages" },
+    { (char*)"stacktrace", T_OBJECT_EX, offsetof(struct sr_py_report, stacktrace), 0,
+      (char*)"Problem stacktrace (:class:`SingleThreadStacktrace` or :class:`MultiThreadStacktrace` object)" },
+    { (char*)"operating_system", T_OBJECT_EX, offsetof(struct sr_py_report, operating_system), 0,
+      (char *)"Operating system (:class:`OperatingSystem` object)" },
+    { (char*)"packages", T_OBJECT_EX, offsetof(struct sr_py_report, packages), 0,
+      (char *)"List of packages (currently a list of :class:`RpmPackage` objects)" },
     { NULL },
 };
 
diff --git a/python/py_rpm_package.c b/python/py_rpm_package.c
index 22165d7..f09b249 100644
--- a/python/py_rpm_package.c
+++ b/python/py_rpm_package.c
@@ -24,9 +24,9 @@
 #include "rpm.h"
 #include "strbuf.h"
 
-#define rpm_package_doc "satyr.RpmPackage - RPM package representation\n" \
-                        "Usage:\n" \
-                        "satyr.RpmPackage() - creates an empty RPM package object\n" \
+#define rpm_package_doc "satyr.RpmPackage - RPM package representation\n\n" \
+                        "Usage:\n\n" \
+                        "satyr.RpmPackage() - creates an empty RPM package object\n\n" \
                         "satyr.RpmPackage(name, epoch, version, release, arch) - creates RPM package\n" \
                         "object with given properties"
 
diff --git a/satyr.spec.in b/satyr.spec.in
index 93ab274..795d007 100644
--- a/satyr.spec.in
+++ b/satyr.spec.in
@@ -11,6 +11,7 @@ Source0: https://fedorahosted.org/released/abrt/satyr-%{version}.tar.xz
 BuildRequires: python2-devel
 BuildRequires: elfutils-devel, elfutils-libelf-devel, binutils-devel
 BuildRequires: rpm-devel
+BuildRequires: python-sphinx
 
 %description
 Satyr is a library that can be used to create and process microreports.
@@ -70,6 +71,7 @@ make check
 %files python
 %dir %{python_sitearch}/%{name}
 %{python_sitearch}/%{name}/*
+%{_mandir}/man3/satyr-python.3*
 
 %changelog
 * Wed Aug 28 2013 Richard Marko<rmarko at redhat.com> 0.8-1
-- 
1.8.3.1



More information about the Crash-catcher mailing list