[gobject-introspection] doctool: Don't put curly braces around the construct props if there are none



commit 6727ebea5bcd2d823fb05c0df67efff4e77436ea
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 15 08:16:16 2013 -0500

    doctool: Don't put curly braces around the construct props if there are none

 giscanner/doctemplates/Gjs/class.tmpl              |    8 ++++++--
 .../Regress.FooBuffer.page                         |    3 +--
 .../Regress.FooInterface.page                      |    3 +--
 .../Regress.FooOtherObject.page                    |    3 +--
 .../Regress.FooSubInterface.page                   |    3 +--
 .../Regress.FooSubobject.page                      |    3 +--
 .../Regress.TestFloating.page                      |    3 +--
 .../Regress.TestFundamentalObject.page             |    3 +--
 .../Regress.TestFundamentalSubObject.page          |    3 +--
 .../Regress.TestInheritDrawable.page               |    3 +--
 .../Regress.TestInterface.page                     |    3 +--
 .../Regress.TestSubObj.page                        |    3 +--
 12 files changed, 17 insertions(+), 24 deletions(-)
---
diff --git a/giscanner/doctemplates/Gjs/class.tmpl b/giscanner/doctemplates/Gjs/class.tmpl
index 5882d9f..457361c 100644
--- a/giscanner/doctemplates/Gjs/class.tmpl
+++ b/giscanner/doctemplates/Gjs/class.tmpl
@@ -3,12 +3,16 @@
   <synopsis><code>
 const ${namespace.name} = imports.gi.${namespace.name};
 
-let ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}({
+let ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(\
+% if len(node.properties) > 0:
+{
 % 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,
 % endif
 % endfor
-});
+}\
+% endif
+);
   </code></synopsis>
 </%block>
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 1220e81..747301b 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooBuffer.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooBuffer.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let foo_buffer = Regress.FooBuffer({
-});
+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 8e18270..556fe99 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooInterface.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooInterface.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let foo_interface = Regress.FooInterface({
-});
+let foo_interface = Regress.FooInterface();
   </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 b007600..deba490 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooOtherObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooOtherObject.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let foo_other_object = Regress.FooOtherObject({
-});
+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 de03214..03f6888 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubInterface.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubInterface.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let foo_sub_interface = Regress.FooSubInterface({
-});
+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 244f994..fa90c90 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubobject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooSubobject.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let foo_subobject = Regress.FooSubobject({
-});
+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 1d78cd7..4aaa02d 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFloating.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFloating.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let test_floating = Regress.TestFloating({
-});
+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 73312d2..9b06769 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalObject.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let test_fundamental_object = Regress.TestFundamentalObject({
-});
+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 93d6152..19d0c4b 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalSubObject.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestFundamentalSubObject.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let test_fundamental_sub_object = Regress.TestFundamentalSubObject({
-});
+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 d7ac0c5..f3efc9d 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInheritDrawable.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInheritDrawable.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let test_inherit_drawable = Regress.TestInheritDrawable({
-});
+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 de64aad..a91a5d1 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInterface.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestInterface.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let test_interface = Regress.TestInterface({
-});
+let test_interface = Regress.TestInterface();
   </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 9e0566e..5aaae32 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSubObj.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestSubObj.page
@@ -15,8 +15,7 @@
   <synopsis><code>
 const Regress = imports.gi.Regress;
 
-let test_sub_obj = Regress.TestSubObj({
-});
+let test_sub_obj = Regress.TestSubObj();
   </code></synopsis>
 
   


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