[scanner] Create the cachestore in the transformer
authorJohan Dahlin <johan@gnome.org>
Thu, 2 Sep 2010 04:52:45 +0000 (01:52 -0300)
committerJohan Dahlin <johan@gnome.org>
Thu, 2 Sep 2010 10:44:46 +0000 (07:44 -0300)
giscanner/scannermain.py
giscanner/transformer.py

index cbd237303ae917eddc629c49773157e539e13b15..1baed83e60ebeda38ef1646965bbc5045ed00674 100644 (file)
@@ -30,7 +30,6 @@ import tempfile
 
 from giscanner.annotationparser import AnnotationParser
 from giscanner.ast import Include
-from giscanner.cachestore import CacheStore
 from giscanner.dumper import compile_introspection_binary
 from giscanner.gdumpparser import GDumpParser, IntrospectionBinary
 from giscanner.maintransformer import MainTransformer
@@ -261,9 +260,7 @@ def scanner_main(args):
     else:
         symbol_prefixes = None
 
-    cachestore = CacheStore()
-    transformer = Transformer(cachestore,
-                              options.namespace_name,
+    transformer = Transformer(options.namespace_name,
                               options.namespace_version,
                               identifier_prefixes=identifier_prefixes,
                               symbol_prefixes=symbol_prefixes,
index 73430e2bc136a3ec9d2f5c2e2b561e3ad13cff67..a58d60ca733f782fe416afc6224b37565ba136f4 100644 (file)
@@ -24,6 +24,7 @@ import re
 
 from . import ast
 from . import glibast
+from .cachestore import CacheStore
 from .config import DATADIR, GIR_DIR, GIR_SUFFIX
 from .girparser import GIRParser
 from .sourcescanner import (
@@ -46,11 +47,11 @@ class Transformer(object):
 
     UCASE_CONSTANT_RE = re.compile(r'[_A-Z0-9]+')
 
-    def __init__(self, cachestore, namespace_name, namespace_version,
+    def __init__(self, namespace_name, namespace_version,
                  identifier_prefixes=None, symbol_prefixes=None,
                  accept_unprefixed=False):
         self._cwd = os.getcwd() + os.sep
-        self._cachestore = cachestore
+        self._cachestore = CacheStore()
         self.generator = None
         self._accept_unprefixed = accept_unprefixed
         self._namespace = ast.Namespace(namespace_name, namespace_version,