diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-02 11:24:13 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-11 12:34:52 -0500 |
commit | c9450dc3d7e2f87fa980923594736621f0ecd6ae (patch) | |
tree | 6f1f986fe8fb00dcc83014a745e85a1b73345dc5 /giscanner/docwriter.py | |
parent | ff80c6d88a28b26576508ab891c9b9da0b13ac49 (diff) | |
download | gobject-introspection-c9450dc3d7e2f87fa980923594736621f0ecd6ae.tar.gz |
docwriter: Define a new formatter method for getting params
This will let us gracefully skip over parameters that aren't exposed
by specific language bindings.
It also fixes a bug in the C/Python documentation where we weren't
iterating over the right parameters.
Diffstat (limited to 'giscanner/docwriter.py')
-rw-r--r-- | giscanner/docwriter.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py index 2b9cb0fc..be4d74ff 100644 --- a/giscanner/docwriter.py +++ b/giscanner/docwriter.py @@ -289,6 +289,9 @@ class DocFormatter(object): return dispatch[kind](node, match, props) + def get_parameters(self, node): + raise NotImplementedError + def format_inline(self, node, para): tokens = self._scanner.scan(para) words = [self._process_token(node, tok) for tok in tokens] @@ -374,6 +377,9 @@ class DocFormatterC(DocFormatter): else: return func.name + def get_parameters(self, node): + return node.all_parameters + class DocFormatterPython(DocFormatter): language = "Python" mime_type = "text/python" @@ -450,6 +456,9 @@ class DocFormatterPython(DocFormatter): else: return func.name + def get_parameters(self, node): + return node.all_parameters + class DocFormatterGjs(DocFormatter): language = "Gjs" mime_type = "text/x-gjs" @@ -520,6 +529,9 @@ class DocFormatterGjs(DocFormatter): else: return func.name + def get_parameters(self, node): + return node.parameters + LANGUAGES = { "c": DocFormatterC, "python": DocFormatterPython, |