From fb98a4f19da972709ac56b89a1184624e23bc224 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 20 Feb 2012 12:21:41 +0100 Subject: g-ir-doc-tool: Show how to construct instances in the Class page --- giscanner/mallard-Python-class.tmpl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'giscanner/mallard-Python-class.tmpl') diff --git a/giscanner/mallard-Python-class.tmpl b/giscanner/mallard-Python-class.tmpl index 1dd8644d..d45b0ab6 100644 --- a/giscanner/mallard-Python-class.tmpl +++ b/giscanner/mallard-Python-class.tmpl @@ -21,11 +21,19 @@ ${formatter.format(node.doc)} - - Constructors - +

Constructor

+ +${formatter.to_underscores(node.name).lower()} = ${node.name}(\ +% for property_, ix in zip(node.properties, range(len(node.properties))): +% if property_.construct or property_.construct_only or property_.writable: +${property_.name.replace('-', '_')}=value\ +% if ix != len(node.properties) - 1: +, \ +% endif +% endif +% endfor +)\ + -- cgit v1.2.1