summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-02-01 20:01:56 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-02-01 20:17:16 -0500
commit607ec4a55fce7e8e73a901420745b2c80df164f6 (patch)
tree8d77625f96f39e91acf10e6d2b9cfef325937592
parent8577f17cde7db54584dea9e722fc065341fc2f8e (diff)
downloadgobject-introspection-607ec4a55fce7e8e73a901420745b2c80df164f6.tar.gz
mallardwriter: Fix code for self-parameter forcing
-rw-r--r--giscanner/mallardwriter.py2
-rw-r--r--tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page4
2 files changed, 3 insertions, 3 deletions
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index ece54a9b..a4e9c073 100644
--- a/giscanner/mallardwriter.py
+++ b/giscanner/mallardwriter.py
@@ -404,7 +404,7 @@ class MallardFormatterPython(MallardFormatter):
def format_parameter_name(self, node, parameter):
# Force "self" for the first parameter of a method
- if self.is_method(node) and parameter is node.parameters[0]:
+ if self.is_method(node) and parameter is node.instance_parameter:
return "self"
else:
return parameter.argname
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 0b5681eb..390c40c2 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
@@ -52,7 +52,7 @@ def method(self, first_arg, second_arg, boolean_arg, pointer_arg, string):
<p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj"/> that was
created with <link xref="DocExamples.Obj.new"/>, by passing it
-in as <code>obj</code>.</p><p>This should be a %FALSEALARM.</p>
+in as <code>self</code>.</p><p>This should be a %FALSEALARM.</p>
<p>Since 0.99</p>
@@ -66,7 +66,7 @@ in as <code>obj</code>.</p><p>This should be a %FALSEALARM.</p>
<dt><p>boolean_arg :</p></dt>
<dd><p>You should always pass <code>True</code>.</p></dd>
<dt><p>pointer_arg :</p></dt>
-<dd><p>If not <code>None</code>, do a thing. Pass <code>self</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></dd>
+<dd><p>If not <code>None</code>, do a thing. Pass <code>first_arg</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></dd>
<dt><p>string :</p></dt>
<dd><p>A NUL-terminated string.</p></dd>
<dt><p>Returns :</p></dt>