diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-01-09 02:43:38 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-01-09 03:16:14 -0500 |
commit | dfe8115c77519f9e3d505000fb2a82e14a777cf6 (patch) | |
tree | acd74d75ae15670cae1464c1b8285929c248044e | |
parent | b14f0e075a8c01bc9612006af7d5ffffdfa6e7aa (diff) | |
download | gobject-introspection-dfe8115c77519f9e3d505000fb2a82e14a777cf6.tar.gz |
doc: Add self to methods in the Python declarations
-rw-r--r-- | giscanner/mallard-Python-function.tmpl | 3 | ||||
-rw-r--r-- | tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/mallard-Python-function.tmpl b/giscanner/mallard-Python-function.tmpl index 9ccc723c..03a3e394 100644 --- a/giscanner/mallard-Python-function.tmpl +++ b/giscanner/mallard-Python-function.tmpl @@ -56,6 +56,9 @@ ${formatter.format_type(arg.type) | x}\ @returns(${formatter.format_type(node.retval.type) | x}) def \ ${node.name}(\ +% if node.is_method: +self, \ +% endif % for arg, ix in zip(node.parameters, range(len(node.parameters))): ${arg.argname}\ % if ix != len(node.parameters) - 1: diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page index 3a20d14c..8447be6b 100644 --- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page +++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page @@ -43,7 +43,7 @@ <synopsis><code mime="text/x-python"> @accepts(gint, gfloat, gboolean, gpointer, utf8) @returns(gboolean) -def method(first_arg, second_arg, boolean_arg, pointer_arg, string): +def method(self, first_arg, second_arg, boolean_arg, pointer_arg, string): # Python wrapper for doc_examples_obj_method() </code></synopsis> <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was |