[gobject-introspection] g-ir-doc-tool: Add the first argument of signals to the Python docs



commit c383f8569a58d91de9e64d78b777d1a3925c3780
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date:   Tue Feb 21 16:22:16 2012 +0100

    g-ir-doc-tool: Add the first argument of signals to the Python docs

 giscanner/mallard-Python-signal.tmpl               |    8 +++++---
 .../DocExamples.Obj-signal-example.page            |    6 +++++-
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/giscanner/mallard-Python-signal.tmpl b/giscanner/mallard-Python-signal.tmpl
index 7dcbb0c..fed0659 100644
--- a/giscanner/mallard-Python-signal.tmpl
+++ b/giscanner/mallard-Python-signal.tmpl
@@ -10,7 +10,7 @@
   </info>
   <title>${namespace.name}.${node.parent.name}::${node.name}</title>
 <synopsis><code mime="text/x-python">
-def callback(\
+def callback(${formatter.to_underscores(node.parent.name).lower()}, \
 % for arg, ix in zip(node.parameters, range(len(node.parameters))):
 ${arg.argname}, \
 % endfor
@@ -18,8 +18,11 @@ user_param1, ...)
 </code></synopsis>
 ${formatter.format(node.doc)}
 
-% if node.parameters or node.retval:
 <table>
+<tr>
+<td><p>${formatter.to_underscores(node.parent.name).lower()} :</p></td>
+<td><p>instance of ${namespace.name}.${node.parent.name} that is emitting the signal</p></td>
+</tr>
 % for arg, ix in zip(node.parameters, range(len(node.parameters))):
 <tr>
 <td><p>${arg.argname} :</p></td>
@@ -43,7 +46,6 @@ ${formatter.format(node.doc)}
 </tr>
 % endif
 </table>
-% endif
 % if node.version:
 <p>Since ${node.version}</p>
 % endif
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page
index 5d240fa..76a89f3 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page
@@ -10,7 +10,7 @@
   </info>
   <title>DocExamples.Obj::signal-example</title>
 <synopsis><code mime="text/x-python">
-def callback(float_param, since, user_param1, ...)
+def callback(obj, float_param, since, user_param1, ...)
 </code></synopsis>
 <p>Emitted when the connection status on the account changes.</p><p>The @dbus_error_name and @details parameters were present, but
 non-functional (always None), in older versions. They have been
@@ -18,6 +18,10 @@ available with their current behaviour since version 0.11.7.</p>
 
 <table>
 <tr>
+<td><p>obj :</p></td>
+<td><p>instance of DocExamples.Obj that is emitting the signal</p></td>
+</tr>
+<tr>
 <td><p>float_param :</p></td>
 <td><p>a parameter of type float</p></td>
 </tr>



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