diff options
author | Colin Walters <walters@verbum.org> | 2013-02-24 03:55:18 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-02-26 16:25:11 -0500 |
commit | dfeaf33c8a4ae7e25b4a83d0b31c4d435b4ef7de (patch) | |
tree | 86776c3fbf1ddb2db7d29125c48d6830d8b5ffc5 /giscanner/girwriter.py | |
parent | 971d1f98053eec324756429a7966aab2279abd87 (diff) | |
download | gobject-introspection-dfeaf33c8a4ae7e25b4a83d0b31c4d435b4ef7de.tar.gz |
scanner: internals cleanup: Key more things off Namespace
The .gir format has a weird legacy where stuff like the includes are
outside of the <namespace>. But conceptually they're tied together,
so let's start reflecting this in the code.
This way we can just pass around and look at a Namespace object
instead of a 4-tuple of (namespace, includes, c_includes, pkg_config).
https://bugzilla.gnome.org/show_bug.cgi?id=694593
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r-- | giscanner/girwriter.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index ea9305cd..73b58772 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -30,19 +30,17 @@ COMPATIBLE_GIR_VERSION = '1.2' class GIRWriter(XMLWriter): - def __init__(self, namespace, shlibs, includes, pkgs, c_includes): + def __init__(self, namespace, shlibs, pkgs, c_includes): super(GIRWriter, self).__init__() self.write_comment( '''This file was automatically generated from C sources - DO NOT EDIT! To affect the contents of this file, edit the original C definitions, and/or use gtk-doc annotations. ''') - self._write_repository(namespace, shlibs, includes, pkgs, + self._write_repository(namespace, shlibs, pkgs, c_includes) - def _write_repository(self, namespace, shlibs, includes=None, + def _write_repository(self, namespace, shlibs, packages=None, c_includes=None): - if includes is None: - includes = frozenset() if packages is None: packages = frozenset() if c_includes is None: @@ -54,7 +52,7 @@ and/or use gtk-doc annotations. ''') ('xmlns:glib', 'http://www.gtk.org/introspection/glib/1.0'), ] with self.tagcontext('repository', attrs): - for include in sorted(includes): + for include in sorted(namespace.includes): self._write_include(include) for pkg in sorted(set(packages)): self._write_pkgconfig_pkg(pkg) |