doc: Add self to methods in the Python declarations
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 9 Jan 2013 07:43:38 +0000 (02:43 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 9 Jan 2013 08:16:14 +0000 (03:16 -0500)
giscanner/mallard-Python-function.tmpl
tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page

index 9ccc723..03a3e39 100644 (file)
@@ -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:
index 3a20d14..8447be6 100644 (file)
@@ -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