]> sigrok.org Git - libsigrok.git/blobdiff - bindings/python/sigrok/core/classes.i
input: Convert CSV module.
[libsigrok.git] / bindings / python / sigrok / core / classes.i
index 126991b7c247d58e8fd8ae75d7eabbee76f0e24c..015011ea8e1aa729fa5c249129dc1371d1976b4c 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-%module classes
+%define DOCSTRING
+"@mainpage API Reference
+
+Introduction
+------------
+
+The pysigrok API provides an object-oriented Python interface to the
+functionality in libsigrok. It is built on top of the sigrok++ C++ API.
+
+Getting started
+---------------
+
+Usage of the pysigrok API needs to begin with a call to Context.create().
+This will create the global libsigrok context and returns a Context object.
+Methods on this object provide access to the hardware drivers, input and output
+formats supported by the library, as well as means of creating other objects
+such as sessions and triggers.
+
+Error handling
+--------------
+
+When any libsigrok C API call returns an error, an Error exception is raised,
+which provides access to the error code and description."
+%enddef
+
+%module(docstring=DOCSTRING) classes
 
 %{
 #include <pygobject.h>
@@ -26,7 +51,7 @@ PyObject *GLib;
 PyTypeObject *IOChannel;
 PyTypeObject *PollFD;
 
-#include "../../../../config.h"
+#include "config.h"
 
 #if PYGOBJECT_FLAGS_SIGNED
 typedef gint pyg_flags_type;
@@ -332,6 +357,8 @@ std::map<std::string, Glib::VariantBase> dict_to_map_options(PyObject *dict,
 %ignore sigrok::InputFormat::open_file;
 %ignore sigrok::OutputFormat::create_output;
 
+%include "doc.i"
+
 %include "../../../swig/classes.i"
 
 /* Support Driver.scan() with keyword arguments. */