diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-14 13:28:38 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-14 13:28:38 +0000 |
commit | b686c1e8a9b94aca6a6a6bc8fd457ed4d8297197 (patch) | |
tree | 2677a1f7aba288b3cfec5982dac2e395a9af09a5 /tools/glib-gtypes-generator.py | |
parent | ce495de86d3ce4f0cdf0a9d38dbf6c23944439f5 (diff) | |
download | telepathy-glib-b686c1e8a9b94aca6a6a6bc8fd457ed4d8297197.tar.gz |
Move get_docstring to libglibcodegen and make it work with elements that have children with docstrings
20071214132838-53eee-4931eed9ca9eee7593a917de8cead0495128a947.gz
Diffstat (limited to 'tools/glib-gtypes-generator.py')
-rw-r--r-- | tools/glib-gtypes-generator.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py index f9584fc6e..a73ec8fcf 100644 --- a/tools/glib-gtypes-generator.py +++ b/tools/glib-gtypes-generator.py @@ -24,6 +24,7 @@ import sys import xml.dom.minidom from libglibcodegen import escape_as_identifier, \ + get_docstring, \ NS_TP, \ Signature, \ type_to_gtype @@ -33,19 +34,6 @@ def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] -def get_docstring(element): - docstring = element.getElementsByTagNameNS(NS_TP, 'docstring') - if docstring: - docstring = docstring[0].toxml().replace('\n', ' ').strip() - if docstring.startswith('<tp:docstring>'): - docstring = docstring[14:].lstrip() - if docstring.endswith('</tp:docstring>'): - docstring = docstring[:-15].rstrip() - if docstring in ('<tp:docstring/>', ''): - docstring = '' - return docstring - - class GTypesGenerator(object): def __init__(self, dom, output, mixed_case_prefix): self.dom = dom |