[gobject-introspection] mallardwriter: Fix code for self-parameter forcing



commit 607ec4a55fce7e8e73a901420745b2c80df164f6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 1 20:01:56 2013 -0500

    mallardwriter: Fix code for self-parameter forcing

 giscanner/mallardwriter.py                         |    2 +-
 .../DocExamples.Obj.method.page                    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index ece54a9..a4e9c07 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 0b5681e..390c40c 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>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]