Blame doc/HACKING.txt

Packit 130fc8
=========================================
Packit 130fc8
D-Bus Python bindings - notes for hackers
Packit 130fc8
=========================================
Packit 130fc8
Packit 130fc8
:Author: Simon McVittie, `Collabora`_
Packit 130fc8
:Date: 2007-01-24
Packit 130fc8
Packit 130fc8
.. _Collabora: http://www.collabora.co.uk/
Packit 130fc8
Packit 130fc8
Upstream development
Packit 130fc8
====================
Packit 130fc8
Packit 130fc8
dbus-python is developed at freedesktop.org using ``git``.
Packit 130fc8
See UsingGit_ for some details.
Packit 130fc8
Packit 130fc8
.. _UsingGit: http://www.freedesktop.org/wiki/UsingGit
Packit 130fc8
Packit 130fc8
Anonymous access
Packit 130fc8
    ``git clone git://anongit.freedesktop.org/git/dbus/dbus-python``
Packit 130fc8
Committer access (requires freedesktop.org shell account)
Packit 130fc8
    ``git clone git+ssh://git.freedesktop.org/git/dbus/dbus-python``
Packit 130fc8
Packit 130fc8
Modules
Packit 130fc8
=======
Packit 130fc8
Packit 130fc8
``dbus``, ``dbus.service`` and ``dbus.mainloop`` are core public API.
Packit 130fc8
Packit 130fc8
``dbus.lowlevel`` provides a lower-level public API for advanced use.
Packit 130fc8
Packit 130fc8
``dbus.mainloop.glib`` is the public API for the GLib main loop integration.
Packit 130fc8
Packit 130fc8
``dbus.types`` and ``dbus.exceptions`` are mainly for backwards
Packit 130fc8
compatibility - use ``dbus`` instead in new code. Ditto ``dbus.glib``.
Packit 130fc8
Packit 130fc8
``dbus._dbus``, ``dbus.introspect_parser``, ``dbus.proxies`` are internal
Packit 130fc8
implementation details.
Packit 130fc8
Packit 130fc8
``_dbus_bindings`` is the real implementation of the Python/libdbus
Packit 130fc8
integration, while ``_dbus_bindings`` is the real implementation of
Packit 130fc8
Python/libdbus-glib integration. Neither is public API, although some
Packit 130fc8
of the classes and functions are exposed as public API in other modules.
Packit 130fc8
Packit 130fc8
Threading/locking model
Packit 130fc8
=======================
Packit 130fc8
Packit 130fc8
All Python functions must be called with the GIL (obviously).
Packit 130fc8
Packit 130fc8
Before calling into any D-Bus function that can block, release the GIL;
Packit 130fc8
as well as the usual "be nice to other threads", D-Bus does its own
Packit 130fc8
locking and we don't want to deadlock with it. Most Connection methods
Packit 130fc8
can block.
Packit 130fc8
Packit 130fc8
Other notes
Packit 130fc8
===========
Packit 130fc8
Packit 130fc8
Code needs to be Python 2.5 compatible - use Py_ssize_t where appropriate.
Packit 130fc8
See http://www.python.org/dev/peps/pep-0353/ for details.
Packit 130fc8
Packit 130fc8
Indentation and other holy wars
Packit 130fc8
===============================
Packit 130fc8
Packit 130fc8
Python code is meant to follow PEP8, and has 4-space indentation, no hard tabs.
Packit 130fc8
Packit 130fc8
C code is meant to follow what PEP7 refers to as "Python 3000" style - 4-space
Packit 130fc8
indentation, no hard tabs, otherwise consistent with historical Python 2.x
Packit 130fc8
code.
Packit 130fc8
Packit 130fc8
Docstrings etc. are reStructuredText.