summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-01-09 02:46:38 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-01-09 03:16:14 -0500
commit634961eac7186ec95680916de0b627ea1c7441e7 (patch)
tree4ddc6e8cf82d07e3ec164a18508dcbff65bde0e0 /giscanner
parentdfe8115c77519f9e3d505000fb2a82e14a777cf6 (diff)
downloadgobject-introspection-634961eac7186ec95680916de0b627ea1c7441e7.tar.gz
doc: Clean up signature generation a bit more
Use join and a genexp instead of manual comma tracking to make our lives just a little easier.
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/mallard-Python-function.tmpl14
-rw-r--r--giscanner/mallard-Python-vfunc.tmpl14
2 files changed, 4 insertions, 24 deletions
diff --git a/giscanner/mallard-Python-function.tmpl b/giscanner/mallard-Python-function.tmpl
index 03a3e394..5ccc800a 100644
--- a/giscanner/mallard-Python-function.tmpl
+++ b/giscanner/mallard-Python-function.tmpl
@@ -45,12 +45,7 @@ elif node.is_method:
<synopsis><code mime="text/x-python">
% if len(node.parameters) != 0:
@accepts(\
-% for arg, ix in zip(node.parameters, range(len(node.parameters))):
-${formatter.format_type(arg.type) | x}\
-% if ix != len(node.parameters) - 1:
-, \
-%endif
-% endfor
+${', '.join((formatter.format_type(arg.type) for arg in node.parameters))}\
)
% endif
@returns(${formatter.format_type(node.retval.type) | x})
@@ -59,12 +54,7 @@ ${node.name}(\
% if node.is_method:
self, \
% endif
-% for arg, ix in zip(node.parameters, range(len(node.parameters))):
-${arg.argname}\
-% if ix != len(node.parameters) - 1:
-, \
-%endif
-% endfor
+${', '.join((arg.argname for arg in node.parameters))}\
):
# Python wrapper for ${node.symbol}()
</code></synopsis>
diff --git a/giscanner/mallard-Python-vfunc.tmpl b/giscanner/mallard-Python-vfunc.tmpl
index 4c7ab8f9..0c93abbc 100644
--- a/giscanner/mallard-Python-vfunc.tmpl
+++ b/giscanner/mallard-Python-vfunc.tmpl
@@ -13,23 +13,13 @@
<synopsis><code mime="text/x-python">
% if len(node.parameters) != 0:
@accepts(\
-% for arg, ix in zip(node.parameters, range(len(node.parameters))):
-${formatter.format_type(arg.type) | x}\
-% if ix != len(node.parameters) - 1:
-, \
-%endif
-% endfor
+${', '.join((formatter.format_type(arg.type) for arg in node.parameters))}\
)
% endif
@returns(${formatter.format_type(node.retval.type) | x})
def \
do_${node.name}(self, \
-% for arg, ix in zip(node.parameters, range(len(node.parameters))):
-${arg.argname}\
-% if ix != len(node.parameters) - 1:
-, \
-%endif
-% endfor
+${', '.join((arg.argname for arg in node.parameters))}\
):
</code></synopsis>
${formatter.format(node, node.doc)}