home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / doc / python-dbus / HACKING.html < prev    next >
Encoding:
Extensible Markup Language  |  2007-02-19  |  10.3 KB  |  362 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.4.1: http://docutils.sourceforge.net/" />
  7. <title>D-Bus Python bindings - notes for hackers</title>
  8. <meta name="author" content="Simon McVittie, Collabora" />
  9. <meta name="date" content="2007-01-24" />
  10. <style type="text/css">
  11.  
  12. /*
  13. :Author: David Goodger
  14. :Contact: goodger@users.sourceforge.net
  15. :Date: $Date: 2005-12-18 01:56:14 +0100 (Sun, 18 Dec 2005) $
  16. :Revision: $Revision: 4224 $
  17. :Copyright: This stylesheet has been placed in the public domain.
  18.  
  19. Default cascading style sheet for the HTML output of Docutils.
  20.  
  21. See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
  22. customize this style sheet.
  23. */
  24.  
  25. /* used to remove borders from tables and images */
  26. .borderless, table.borderless td, table.borderless th {
  27.   border: 0 }
  28.  
  29. table.borderless td, table.borderless th {
  30.   /* Override padding for "table.docutils td" with "! important".
  31.      The right padding separates the table cells. */
  32.   padding: 0 0.5em 0 0 ! important }
  33.  
  34. .first {
  35.   /* Override more specific margin styles with "! important". */
  36.   margin-top: 0 ! important }
  37.  
  38. .last, .with-subtitle {
  39.   margin-bottom: 0 ! important }
  40.  
  41. .hidden {
  42.   display: none }
  43.  
  44. a.toc-backref {
  45.   text-decoration: none ;
  46.   color: black }
  47.  
  48. blockquote.epigraph {
  49.   margin: 2em 5em ; }
  50.  
  51. dl.docutils dd {
  52.   margin-bottom: 0.5em }
  53.  
  54. /* Uncomment (and remove this text!) to get bold-faced definition list terms
  55. dl.docutils dt {
  56.   font-weight: bold }
  57. */
  58.  
  59. div.abstract {
  60.   margin: 2em 5em }
  61.  
  62. div.abstract p.topic-title {
  63.   font-weight: bold ;
  64.   text-align: center }
  65.  
  66. div.admonition, div.attention, div.caution, div.danger, div.error,
  67. div.hint, div.important, div.note, div.tip, div.warning {
  68.   margin: 2em ;
  69.   border: medium outset ;
  70.   padding: 1em }
  71.  
  72. div.admonition p.admonition-title, div.hint p.admonition-title,
  73. div.important p.admonition-title, div.note p.admonition-title,
  74. div.tip p.admonition-title {
  75.   font-weight: bold ;
  76.   font-family: sans-serif }
  77.  
  78. div.attention p.admonition-title, div.caution p.admonition-title,
  79. div.danger p.admonition-title, div.error p.admonition-title,
  80. div.warning p.admonition-title {
  81.   color: red ;
  82.   font-weight: bold ;
  83.   font-family: sans-serif }
  84.  
  85. /* Uncomment (and remove this text!) to get reduced vertical space in
  86.    compound paragraphs.
  87. div.compound .compound-first, div.compound .compound-middle {
  88.   margin-bottom: 0.5em }
  89.  
  90. div.compound .compound-last, div.compound .compound-middle {
  91.   margin-top: 0.5em }
  92. */
  93.  
  94. div.dedication {
  95.   margin: 2em 5em ;
  96.   text-align: center ;
  97.   font-style: italic }
  98.  
  99. div.dedication p.topic-title {
  100.   font-weight: bold ;
  101.   font-style: normal }
  102.  
  103. div.figure {
  104.   margin-left: 2em ;
  105.   margin-right: 2em }
  106.  
  107. div.footer, div.header {
  108.   clear: both;
  109.   font-size: smaller }
  110.  
  111. div.line-block {
  112.   display: block ;
  113.   margin-top: 1em ;
  114.   margin-bottom: 1em }
  115.  
  116. div.line-block div.line-block {
  117.   margin-top: 0 ;
  118.   margin-bottom: 0 ;
  119.   margin-left: 1.5em }
  120.  
  121. div.sidebar {
  122.   margin-left: 1em ;
  123.   border: medium outset ;
  124.   padding: 1em ;
  125.   background-color: #ffffee ;
  126.   width: 40% ;
  127.   float: right ;
  128.   clear: right }
  129.  
  130. div.sidebar p.rubric {
  131.   font-family: sans-serif ;
  132.   font-size: medium }
  133.  
  134. div.system-messages {
  135.   margin: 5em }
  136.  
  137. div.system-messages h1 {
  138.   color: red }
  139.  
  140. div.system-message {
  141.   border: medium outset ;
  142.   padding: 1em }
  143.  
  144. div.system-message p.system-message-title {
  145.   color: red ;
  146.   font-weight: bold }
  147.  
  148. div.topic {
  149.   margin: 2em }
  150.  
  151. h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
  152. h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  153.   margin-top: 0.4em }
  154.  
  155. h1.title {
  156.   text-align: center }
  157.  
  158. h2.subtitle {
  159.   text-align: center }
  160.  
  161. hr.docutils {
  162.   width: 75% }
  163.  
  164. img.align-left {
  165.   clear: left }
  166.  
  167. img.align-right {
  168.   clear: right }
  169.  
  170. ol.simple, ul.simple {
  171.   margin-bottom: 1em }
  172.  
  173. ol.arabic {
  174.   list-style: decimal }
  175.  
  176. ol.loweralpha {
  177.   list-style: lower-alpha }
  178.  
  179. ol.upperalpha {
  180.   list-style: upper-alpha }
  181.  
  182. ol.lowerroman {
  183.   list-style: lower-roman }
  184.  
  185. ol.upperroman {
  186.   list-style: upper-roman }
  187.  
  188. p.attribution {
  189.   text-align: right ;
  190.   margin-left: 50% }
  191.  
  192. p.caption {
  193.   font-style: italic }
  194.  
  195. p.credits {
  196.   font-style: italic ;
  197.   font-size: smaller }
  198.  
  199. p.label {
  200.   white-space: nowrap }
  201.  
  202. p.rubric {
  203.   font-weight: bold ;
  204.   font-size: larger ;
  205.   color: maroon ;
  206.   text-align: center }
  207.  
  208. p.sidebar-title {
  209.   font-family: sans-serif ;
  210.   font-weight: bold ;
  211.   font-size: larger }
  212.  
  213. p.sidebar-subtitle {
  214.   font-family: sans-serif ;
  215.   font-weight: bold }
  216.  
  217. p.topic-title {
  218.   font-weight: bold }
  219.  
  220. pre.address {
  221.   margin-bottom: 0 ;
  222.   margin-top: 0 ;
  223.   font-family: serif ;
  224.   font-size: 100% }
  225.  
  226. pre.literal-block, pre.doctest-block {
  227.   margin-left: 2em ;
  228.   margin-right: 2em ;
  229.   background-color: #eeeeee }
  230.  
  231. span.classifier {
  232.   font-family: sans-serif ;
  233.   font-style: oblique }
  234.  
  235. span.classifier-delimiter {
  236.   font-family: sans-serif ;
  237.   font-weight: bold }
  238.  
  239. span.interpreted {
  240.   font-family: sans-serif }
  241.  
  242. span.option {
  243.   white-space: nowrap }
  244.  
  245. span.pre {
  246.   white-space: pre }
  247.  
  248. span.problematic {
  249.   color: red }
  250.  
  251. span.section-subtitle {
  252.   /* font-size relative to parent (h1..h6 element) */
  253.   font-size: 80% }
  254.  
  255. table.citation {
  256.   border-left: solid 1px gray;
  257.   margin-left: 1px }
  258.  
  259. table.docinfo {
  260.   margin: 2em 4em }
  261.  
  262. table.docutils {
  263.   margin-top: 0.5em ;
  264.   margin-bottom: 0.5em }
  265.  
  266. table.footnote {
  267.   border-left: solid 1px black;
  268.   margin-left: 1px }
  269.  
  270. table.docutils td, table.docutils th,
  271. table.docinfo td, table.docinfo th {
  272.   padding-left: 0.5em ;
  273.   padding-right: 0.5em ;
  274.   vertical-align: top }
  275.  
  276. table.docutils th.field-name, table.docinfo th.docinfo-name {
  277.   font-weight: bold ;
  278.   text-align: left ;
  279.   white-space: nowrap ;
  280.   padding-left: 0 }
  281.  
  282. h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
  283. h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  284.   font-size: 100% }
  285.  
  286. tt.docutils {
  287.   background-color: #eeeeee }
  288.  
  289. ul.auto-toc {
  290.   list-style-type: none }
  291.  
  292. </style>
  293. </head>
  294. <body>
  295. <div class="document" id="d-bus-python-bindings-notes-for-hackers">
  296. <h1 class="title">D-Bus Python bindings - notes for hackers</h1>
  297. <table class="docinfo" frame="void" rules="none">
  298. <col class="docinfo-name" />
  299. <col class="docinfo-content" />
  300. <tbody valign="top">
  301. <tr><th class="docinfo-name">Author:</th>
  302. <td>Simon McVittie, <a class="last reference" href="http://www.collabora.co.uk/">Collabora</a></td></tr>
  303. <tr><th class="docinfo-name">Date:</th>
  304. <td>2007-01-24</td></tr>
  305. </tbody>
  306. </table>
  307. <div class="section">
  308. <h1><a id="upstream-development" name="upstream-development">Upstream development</a></h1>
  309. <p>dbus-python is developed at freedesktop.org using <tt class="docutils literal"><span class="pre">git</span></tt>.
  310. See <a class="reference" href="http://www.freedesktop.org/wiki/UsingGit">UsingGit</a> for some details.</p>
  311. <dl class="docutils">
  312. <dt>Anonymous access</dt>
  313. <dd><tt class="docutils literal"><span class="pre">git</span> <span class="pre">clone</span> <span class="pre">git://anongit.freedesktop.org/git/dbus/dbus-python</span></tt></dd>
  314. <dt>Committer access (requires freedesktop.org shell account)</dt>
  315. <dd><tt class="docutils literal"><span class="pre">git</span> <span class="pre">clone</span> <span class="pre">git+ssh://git.freedesktop.org/git/dbus/dbus-python</span></tt></dd>
  316. </dl>
  317. </div>
  318. <div class="section">
  319. <h1><a id="modules" name="modules">Modules</a></h1>
  320. <p><tt class="docutils literal"><span class="pre">dbus</span></tt>, <tt class="docutils literal"><span class="pre">dbus.service</span></tt> and <tt class="docutils literal"><span class="pre">dbus.mainloop</span></tt> are core public API.</p>
  321. <p><tt class="docutils literal"><span class="pre">dbus.lowlevel</span></tt> provides a lower-level public API for advanced use.</p>
  322. <p><tt class="docutils literal"><span class="pre">dbus.mainloop.glib</span></tt> is the public API for the GLib main loop integration.</p>
  323. <p><tt class="docutils literal"><span class="pre">dbus.types</span></tt> and <tt class="docutils literal"><span class="pre">dbus.exceptions</span></tt> are mainly for backwards
  324. compatibility - use <tt class="docutils literal"><span class="pre">dbus</span></tt> instead in new code. Ditto <tt class="docutils literal"><span class="pre">dbus.glib</span></tt>.</p>
  325. <p><tt class="docutils literal"><span class="pre">dbus._dbus</span></tt>, <tt class="docutils literal"><span class="pre">dbus.introspect_parser</span></tt>, <tt class="docutils literal"><span class="pre">dbus.proxies</span></tt> are internal
  326. implementation details.</p>
  327. <p><tt class="docutils literal"><span class="pre">_dbus_bindings</span></tt> is the real implementation of the Python/libdbus
  328. integration, while <tt class="docutils literal"><span class="pre">_dbus_bindings</span></tt> is the real implementation of
  329. Python/libdbus-glib integration. Neither is public API, although some
  330. of the classes and functions are exposed as public API in other modules.</p>
  331. </div>
  332. <div class="section">
  333. <h1><a id="threading-locking-model" name="threading-locking-model">Threading/locking model</a></h1>
  334. <p>All Python functions must be called with the GIL (obviously).</p>
  335. <p>Before calling into any D-Bus function that can block, release the GIL;
  336. as well as the usual "be nice to other threads", D-Bus does its own
  337. locking and we don't want to deadlock with it. Most Connection methods
  338. can block.</p>
  339. </div>
  340. <div class="section">
  341. <h1><a id="other-notes" name="other-notes">Other notes</a></h1>
  342. <p>Code needs to be Python 2.5 compatible - use Py_ssize_t where appropriate.
  343. See <a class="reference" href="http://www.python.org/dev/peps/pep-0353/">http://www.python.org/dev/peps/pep-0353/</a> for details.</p>
  344. </div>
  345. <div class="section">
  346. <h1><a id="indentation-and-other-holy-wars" name="indentation-and-other-holy-wars">Indentation and other holy wars</a></h1>
  347. <p>Python code is meant to follow PEP8, and has 4-space indentation, no hard tabs.</p>
  348. <p>C code is meant to follow what PEP7 refers to as "Python 3000" style - 4-space
  349. indentation, no hard tabs, otherwise consistent with historical Python 2.x
  350. code.</p>
  351. <p>Docstrings etc. are reStructuredText.</p>
  352. </div>
  353. </div>
  354. <div class="footer">
  355. <hr class="footer" />
  356. Generated on: 2007-02-19 23:39 UTC.
  357. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
  358.  
  359. </div>
  360. </body>
  361. </html>
  362.