[gobject-introspection] doctool: Fix Gjs class signature



commit 71a1705667f297c122b8637556924c9d16e36801
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Feb 14 23:04:41 2013 -0500

    doctool: Fix Gjs class signature

 giscanner/doctemplates/Gjs/class.tmpl              |   11 ++++-------
 .../Regress.AnnotationObject.page                  |    9 +++++++--
 .../Regress.FooBuffer.page                         |    6 ++++--
 .../Regress.FooInterface.page                      |    6 ++++--
 .../Regress.FooObject.page                         |    8 ++++++--
 .../Regress.FooOtherObject.page                    |    6 ++++--
 .../Regress.FooSubInterface.page                   |    6 ++++--
 .../Regress.FooSubobject.page                      |    6 ++++--
 .../Regress.TestFloating.page                      |    6 ++++--
 .../Regress.TestFundamentalObject.page             |    6 ++++--
 .../Regress.TestFundamentalSubObject.page          |    6 ++++--
 .../Regress.TestInheritDrawable.page               |    6 ++++--
 .../Regress.TestInterface.page                     |    6 ++++--
 .../Regress-1.0-Gjs-expected/Regress.TestObj.page  |   17 +++++++++++++++--
 .../Regress.TestSubObj.page                        |    6 ++++--
 .../Regress.TestWi8021x.page                       |    7 +++++--
 16 files changed, 81 insertions(+), 37 deletions(-)
---
diff --git a/giscanner/doctemplates/Gjs/class.tmpl b/giscanner/doctemplates/Gjs/class.tmpl
index 435b31a..5882d9f 100644
--- a/giscanner/doctemplates/Gjs/class.tmpl
+++ b/giscanner/doctemplates/Gjs/class.tmpl
@@ -1,17 +1,14 @@
 <%inherit file="/class.tmpl"/>
 <%block name="synopsis">
   <synopsis><code>
-from gi.repository import ${namespace.name}
+const ${namespace.name} = imports.gi.${namespace.name};
 
-${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(\
+let ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}({
 % for ix, property_ in enumerate(node.properties):
 % if property_.construct or property_.construct_only or property_.writable:
-<link xref='${namespace.name}.${node.name}-${property_.name}'>${property_.name.replace('-', 
'_')}</link>=value\
-% if ix != len(node.properties) - 1:
-, \
-% endif
+    <link xref='${namespace.name}.${node.name}-${property_.name}'>${property_.name.replace('-', 
'_')}</link>: value,
 % endif
 % endfor
-)\
+});
   </code></synopsis>
 </%block>
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page
index 8bcae31..e104633 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page
@@ -13,9 +13,14 @@
   <title>Regress.AnnotationObject</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-annotation_object = Regress.AnnotationObject(<link 
xref='Regress.AnnotationObject-function-property'>function_property</link>=value, <link 
xref='Regress.AnnotationObject-string-property'>string_property</link>=value, <link 
xref='Regress.AnnotationObject-tab-property'>tab_property</link>=value)  </code></synopsis>
+let annotation_object = Regress.AnnotationObject({
+    <link xref='Regress.AnnotationObject-function-property'>function_property</link>: value,
+    <link xref='Regress.AnnotationObject-string-property'>string_property</link>: value,
+    <link xref='Regress.AnnotationObject-tab-property'>tab_property</link>: value,
+});
+  </code></synopsis>
 
   
     <p>This is an object used to test regress_annotations.</p>
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooBuffer.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooBuffer.page
index a3b5101..1220e81 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooBuffer.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooBuffer.page
@@ -13,9 +13,11 @@
   <title>Regress.FooBuffer</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-foo_buffer = Regress.FooBuffer()  </code></synopsis>
+let foo_buffer = Regress.FooBuffer({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooInterface.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooInterface.page
index a195bb8..8e18270 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooInterface.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooInterface.page
@@ -13,9 +13,11 @@
   <title>Regress.FooInterface</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-foo_interface = Regress.FooInterface()  </code></synopsis>
+let foo_interface = Regress.FooInterface({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.page
index 6a0810e..9f2290b 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.page
@@ -13,9 +13,13 @@
   <title>Regress.FooObject</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-foo_object = Regress.FooObject(<link xref='Regress.FooObject-hidden'>hidden</link>=value, <link 
xref='Regress.FooObject-string'>string</link>=value)  </code></synopsis>
+let foo_object = Regress.FooObject({
+    <link xref='Regress.FooObject-hidden'>hidden</link>: value,
+    <link xref='Regress.FooObject-string'>string</link>: value,
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooOtherObject.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooOtherObject.page
index 56e0fcb..b007600 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooOtherObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooOtherObject.page
@@ -13,9 +13,11 @@
   <title>Regress.FooOtherObject</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-foo_other_object = Regress.FooOtherObject()  </code></synopsis>
+let foo_other_object = Regress.FooOtherObject({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubInterface.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubInterface.page
index 3b09372..de03214 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubInterface.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubInterface.page
@@ -13,9 +13,11 @@
   <title>Regress.FooSubInterface</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-foo_sub_interface = Regress.FooSubInterface()  </code></synopsis>
+let foo_sub_interface = Regress.FooSubInterface({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubobject.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubobject.page
index f3a8b6d..244f994 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubobject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubobject.page
@@ -13,9 +13,11 @@
   <title>Regress.FooSubobject</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-foo_subobject = Regress.FooSubobject()  </code></synopsis>
+let foo_subobject = Regress.FooSubobject({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFloating.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFloating.page
index 4f1c323..1d78cd7 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFloating.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFloating.page
@@ -13,9 +13,11 @@
   <title>Regress.TestFloating</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_floating = Regress.TestFloating()  </code></synopsis>
+let test_floating = Regress.TestFloating({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalObject.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalObject.page
index ee5ea92..73312d2 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalObject.page
@@ -13,9 +13,11 @@
   <title>Regress.TestFundamentalObject</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_fundamental_object = Regress.TestFundamentalObject()  </code></synopsis>
+let test_fundamental_object = Regress.TestFundamentalObject({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalSubObject.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalSubObject.page
index 1418f6f..93d6152 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalSubObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalSubObject.page
@@ -13,9 +13,11 @@
   <title>Regress.TestFundamentalSubObject</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_fundamental_sub_object = Regress.TestFundamentalSubObject()  </code></synopsis>
+let test_fundamental_sub_object = Regress.TestFundamentalSubObject({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInheritDrawable.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInheritDrawable.page
index e562289..d7ac0c5 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInheritDrawable.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInheritDrawable.page
@@ -13,9 +13,11 @@
   <title>Regress.TestInheritDrawable</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_inherit_drawable = Regress.TestInheritDrawable()  </code></synopsis>
+let test_inherit_drawable = Regress.TestInheritDrawable({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInterface.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInterface.page
index 09c9898..de64aad 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInterface.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInterface.page
@@ -13,9 +13,11 @@
   <title>Regress.TestInterface</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_interface = Regress.TestInterface()  </code></synopsis>
+let test_interface = Regress.TestInterface({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
index 7ee950e..9b4dd9c 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
@@ -13,9 +13,22 @@
   <title>Regress.TestObj</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_obj = Regress.TestObj(<link xref='Regress.TestObj-bare'>bare</link>=value, <link 
xref='Regress.TestObj-boxed'>boxed</link>=value, <link xref='Regress.TestObj-double'>double</link>=value, 
<link xref='Regress.TestObj-float'>float</link>=value, <link xref='Regress.TestObj-gtype'>gtype</link>=value, 
<link xref='Regress.TestObj-hash-table'>hash_table</link>=value, <link 
xref='Regress.TestObj-hash-table-old'>hash_table_old</link>=value, <link 
xref='Regress.TestObj-int'>int</link>=value, <link xref='Regress.TestObj-list'>list</link>=value, <link 
xref='Regress.TestObj-list-old'>list_old</link>=value, <link 
xref='Regress.TestObj-string'>string</link>=value)  </code></synopsis>
+let test_obj = Regress.TestObj({
+    <link xref='Regress.TestObj-bare'>bare</link>: value,
+    <link xref='Regress.TestObj-boxed'>boxed</link>: value,
+    <link xref='Regress.TestObj-double'>double</link>: value,
+    <link xref='Regress.TestObj-float'>float</link>: value,
+    <link xref='Regress.TestObj-gtype'>gtype</link>: value,
+    <link xref='Regress.TestObj-hash-table'>hash_table</link>: value,
+    <link xref='Regress.TestObj-hash-table-old'>hash_table_old</link>: value,
+    <link xref='Regress.TestObj-int'>int</link>: value,
+    <link xref='Regress.TestObj-list'>list</link>: value,
+    <link xref='Regress.TestObj-list-old'>list_old</link>: value,
+    <link xref='Regress.TestObj-string'>string</link>: value,
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSubObj.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSubObj.page
index fe84d57..9e0566e 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSubObj.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSubObj.page
@@ -13,9 +13,11 @@
   <title>Regress.TestSubObj</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_sub_obj = Regress.TestSubObj()  </code></synopsis>
+let test_sub_obj = Regress.TestSubObj({
+});
+  </code></synopsis>
 
   
     
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestWi8021x.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestWi8021x.page
index 2ea9c57..dc09718 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestWi8021x.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestWi8021x.page
@@ -13,9 +13,12 @@
   <title>Regress.TestWi8021x</title>
   
   <synopsis><code>
-from gi.repository import Regress
+const Regress = imports.gi.Regress;
 
-test_wi8021x = Regress.TestWi8021x(<link xref='Regress.TestWi8021x-testbool'>testbool</link>=value)  
</code></synopsis>
+let test_wi8021x = Regress.TestWi8021x({
+    <link xref='Regress.TestWi8021x-testbool'>testbool</link>: value,
+});
+  </code></synopsis>
 
   
     


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