summaryrefslogtreecommitdiff
path: root/giscanner/transformer.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2011-08-11 21:50:25 +1000
committerJohan Dahlin <jdahlin@litl.com>2011-08-11 21:50:25 +1000
commit8c4e8fc1316d173290b4405692236da195b7d403 (patch)
tree89cc44240dc4406693e2a012275cc1f4954f72c3 /giscanner/transformer.py
parentc569d66d3b10ebec842eeb75341e74c0228ba45f (diff)
downloadgobject-introspection-8c4e8fc1316d173290b4405692236da195b7d403.tar.gz
Use a classmethod and s/Transformer/cls/ + s/transformer/self/
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r--giscanner/transformer.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 3bb0d4a6..565d996e 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -178,15 +178,15 @@ None."""
% (girname, searchdirs))
sys.exit(1)
- @staticmethod
- def parse_from_gir(filename):
- transformer = Transformer(None)
- transformer.set_passthrough_mode()
- transformer._parse_include(filename)
- parser = transformer._cachestore.load(filename)
- transformer._namespace = parser.get_namespace()
- del transformer._includes[transformer._namespace.name]
- return transformer
+ @classmethod
+ def parse_from_gir(cls, filename):
+ self = cls(None)
+ self.set_passthrough_mode()
+ self._parse_include(filename)
+ parser = self._cachestore.load(filename)
+ self._namespace = parser.get_namespace()
+ del self._includes[self._namespace.name]
+ return self
def _parse_include(self, filename, uninstalled=False):
parser = None