[gobject-introspection/wip/transformer] [transformer] Make a couple of types private
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/wip/transformer] [transformer] Make a couple of types private
- Date: Sat, 28 Aug 2010 14:11:47 +0000 (UTC)
commit 1cb80a8d09c66e030a4e226408443e0d35d59d99
Author: Johan Dahlin <johan gnome org>
Date: Sat Aug 28 10:47:17 2010 -0300
[transformer] Make a couple of types private
giscanner/transformer.py | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 647dde7..382490a 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -128,7 +128,7 @@ class Transformer(object):
self._parse_include(filename)
self._include_names.add(include)
- def lookup_giname(self, name):
+ def _lookup_giname(self, name):
"""Given a name of the form Foo or Bar.Foo,
return the corresponding ast.Node, or None if none
available. Will throw KeyError however for unknown
@@ -147,7 +147,7 @@ namespaces."""
calls lookup_giname() on the name. Otherwise return
None."""
if typeobj.target_giname:
- return self.lookup_giname(typeobj.target_giname)
+ return self._lookup_giname(typeobj.target_giname)
return None
# Private
@@ -273,7 +273,7 @@ currently-scanned namespace is first."""
return -1
return cmp(x[2], y[2])
- def split_ctype_namespaces(self, ident):
+ def _split_ctype_namespaces(self, ident):
"""Given a StudlyCaps string identifier like FooBar, return a
list of (namespace, stripped_identifier) sorted by namespace length,
or raise ValueError. As a special case, if the current namespace matches,
@@ -314,7 +314,7 @@ it is always biggest (i.e. last)."""
if hidden:
ident = ident[1:]
try:
- matches = self.split_ctype_namespaces(ident)
+ matches = self._split_ctype_namespaces(ident)
except ValueError, e:
self.log_warning(str(e), fatal=fatal)
return None
@@ -483,7 +483,7 @@ it is always biggest (i.e. last)."""
derefed_name = canonical_ctype[:-1]
else:
derefed_name = canonical_ctype
- ftype = ast.Array(None, self.create_type_from_ctype_string(ctype),
+ ftype = ast.Array(None, self._create_type_from_ctype_string(ctype),
ctype=derefed_name)
child_list = list(symbol.base_type.child_list)
ftype.zeroterminated = False
@@ -519,7 +519,7 @@ it is always biggest (i.e. last)."""
if not name:
return None
if symbol.base_type.name:
- target = self.create_type_from_ctype_string(symbol.base_type.name)
+ target = self._create_type_from_ctype_string(symbol.base_type.name)
else:
target = ast.TYPE_ANY
if name in ast.type_names:
@@ -574,8 +574,9 @@ it is always biggest (i.e. last)."""
ctype = self._create_source_type(source_type)
const = ((source_type.type == CTYPE_POINTER) and
(source_type.base_type.type_qualifier & TYPE_QUALIFIER_CONST))
- return self.create_type_from_ctype_string(ctype, is_const=const,
- is_parameter=is_parameter, is_return=is_return)
+ return self._create_type_from_ctype_string(ctype, is_const=const,
+ is_parameter=is_parameter,
+ is_return=is_return)
def _create_bare_container_type(self, base, ctype=None,
is_const=False):
@@ -598,7 +599,7 @@ it is always biggest (i.e. last)."""
return ast.Map(ast.TYPE_ANY, ast.TYPE_ANY, ctype=ctype, is_const=is_const)
return None
- def create_type_from_ctype_string(self, ctype, is_const=False,
+ def _create_type_from_ctype_string(self, ctype, is_const=False,
is_parameter=False, is_return=False):
canonical = self._canonicalize_ctype(ctype)
base = canonical.replace('*', '')
@@ -776,7 +777,7 @@ Note that type resolution may not succeed."""
def _resolve_type_from_ctype(self, typeval):
pointer_stripped = typeval.ctype.replace('*', '')
try:
- matches = self.split_ctype_namespaces(pointer_stripped)
+ matches = self._split_ctype_namespaces(pointer_stripped)
except ValueError, e:
raise TypeResolutionException(e)
target_giname = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]