Debian Codegraph @

HACKING

raw
1 File and directory contents
2 ===========================
3
4 * `lib/` contains the source code
5
6 - `pdfimposer.py` contains the python module which forms the backend
7 - `bookletbinder/` contains the commandline and GTK utility
8
9 * `data/` contains data for bookletbinder
10
11 * `doc/` contains some documentation
12
13 * `tests/` containts some tests scripts and their data files
14
15
16 Coding style
17 ============
18
19 Please try to follow PEP 8 "Style Guide for Python Code".
20
21
22 Docstring conventions
23 =====================
24
25 Please add a docstring for each public object (module, function, class,
26 method, data field, ...)
27
28 As PEP 257 "Docstring conventions" is not so precise, please use the
29 following conventions, inspired from [OpenAlea's] [1].
30
31 We use reStructuredText for the docstrings, so we should add at the
32 beginning of each module:
33
34 __docformat__ = "restructuredtext"
35
36 For each docsting, the first line of the docstring must be a brief synopsis.
37
38 An optional longer explanation may follow.
39
40 It should be followed by these sections:
41
42 - "Parameters" for a function or method which takes arguments;
43 - "Returns" for a function or method which has a return value.
44
45 The syntax for the "parameters" section should be: 2 spaces, a dash, a
46 space, a backquote, argument name, a backquote, a semicolon, a space,
47 description.
48
49 > XXX: Put this ?
50
51 Then, add optional section using sphinx directives ".. todo::, ".. warnings::" etc.
52
53 Here is an example:
54
55 def example(arg1, arg2):
56 """Brief synopsis on 1 line, COMPULSORY.
57
58 This is a longer explanation, if the function or method, which
59 is OPTIONAL.
60
61 :Parameters:
62 - `arg1`: the first value.
63 - `arg2`: the second value.
64
65 :Returns:
66 The return value.
67 """
68
69 > XXX: Perhaps would it be best to use markdown, e.g. with
70 > [python-markdown-api-builder] [2]
71
72 [1]: http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=documentation:doctests:how_to_document_python_api
73
74 [2]: http://gitorious.org/python-markdown-api-builder