[gobject-introspection] [scanner] Move namespace out of Transformer
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] [scanner] Move namespace out of Transformer
- Date: Thu, 2 Sep 2010 12:00:05 +0000 (UTC)
commit d97f1cdf1fd0064f5ec4251f9a1c0335bb808455
Author: Johan Dahlin <johan gnome org>
Date: Thu Sep 2 08:59:51 2010 -0300
[scanner] Move namespace out of Transformer
giscanner/scannermain.py | 11 ++++++-----
giscanner/transformer.py | 8 ++------
2 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 3d27684..cc01032 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -29,7 +29,7 @@ import sys
import tempfile
from giscanner.annotationparser import AnnotationParser
-from giscanner.ast import Include
+from giscanner.ast import Include, Namespace
from giscanner.dumper import compile_introspection_binary
from giscanner.gdumpparser import GDumpParser, IntrospectionBinary
from giscanner.maintransformer import MainTransformer
@@ -260,10 +260,11 @@ def scanner_main(args):
else:
symbol_prefixes = None
- transformer = Transformer(options.namespace_name,
- options.namespace_version,
- identifier_prefixes=identifier_prefixes,
- symbol_prefixes=symbol_prefixes,
+ namespace = Namespace(options.namespace_name,
+ options.namespace_version,
+ identifier_prefixes=identifier_prefixes,
+ symbol_prefixes=symbol_prefixes)
+ transformer = Transformer(namespace,
accept_unprefixed=options.accept_unprefixed)
if options.warn_all:
transformer.enable_warnings(True)
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index ed6dce8..690cbab 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -47,15 +47,11 @@ class Transformer(object):
UCASE_CONSTANT_RE = re.compile(r'[_A-Z0-9]+')
- def __init__(self, namespace_name, namespace_version,
- identifier_prefixes=None, symbol_prefixes=None,
- accept_unprefixed=False):
+ def __init__(self, namespace, accept_unprefixed=False):
self._cwd = os.getcwd() + os.sep
self._cachestore = CacheStore()
self._accept_unprefixed = accept_unprefixed
- self._namespace = ast.Namespace(namespace_name, namespace_version,
- identifier_prefixes=identifier_prefixes,
- symbol_prefixes=symbol_prefixes)
+ self._namespace = namespace
self._pkg_config_packages = set()
self._typedefs_ns = {}
self._enable_warnings = False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]