[gobject-introspection/gir-docbook] Use a classmethod and s/Transformer/cls/ + s/transformer/self/



commit 8c4e8fc1316d173290b4405692236da195b7d403
Author: Johan Dahlin <johan gnome org>
Date:   Thu Aug 11 21:50:25 2011 +1000

    Use a classmethod and s/Transformer/cls/ + s/transformer/self/

 giscanner/transformer.py |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 3bb0d4a..565d996 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]