diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2022-08-30 23:45:50 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2023-01-08 14:03:20 +0000 |
commit | 1053187779726413926676bad585780e4ac13ec0 (patch) | |
tree | ade58ed5bc8cd851d9664f7f12e1325c82d2f466 /giscanner/girwriter.py | |
parent | bfe4b306506547bd7bbc25123c1323e561b5096e (diff) | |
download | gobject-introspection-1053187779726413926676bad585780e4ac13ec0.tar.gz |
Add an optional attribute for the property default value
The default-value attribute for a property element is fundamentally
meant for documentation generators.
We only care about the GIR data, as the conversion from the default
value to a string is lossy by definition, and may very well not
roundtrip.
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r-- | giscanner/girwriter.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index 9ff10d31..a3b3bc3e 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -560,6 +560,8 @@ class GIRWriter(XMLWriter): attrs.append(('setter', prop.setter)) if prop.getter: attrs.append(('getter', prop.getter)) + if prop.default_value: + attrs.append(('default-value', prop.default_value)) with self.tagcontext('property', attrs): self._write_generic(prop) self._write_type(prop.type) |