changeset 49:38fdd422f611

depend.child_type is replaced by null_relocatable.back_type
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 20 Jun 2011 17:49:09 +0800
parents 3936d223989a
children 312dcf38226f
files paraspace/dex_deptracker.py paraspace/dexfile.py
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/paraspace/dex_deptracker.py	Mon Jun 20 13:34:47 2011 +0800
+++ b/paraspace/dex_deptracker.py	Mon Jun 20 17:49:09 2011 +0800
@@ -593,7 +593,7 @@
         
         clazz, pclazz = _resolve_name_path(name_path)
         while isinstance(clazz, dexfile.depend):
-            clazz = clazz.child_type
+            clazz = clazz.back_type
             pass
         
         if isinstance(clazz, dexfile.ref):
--- a/paraspace/dexfile.py	Mon Jun 20 13:34:47 2011 +0800
+++ b/paraspace/dexfile.py	Mon Jun 20 17:49:09 2011 +0800
@@ -417,6 +417,7 @@
 
 
 class null_relocatable(relocatable):
+    back_type = None
     pass
 
 
@@ -424,7 +425,7 @@
 #
 # It is a placeholder for storing relationship defined by an association.
 #
-class ref(null_relocatable):
+class ref(_dex_type):
     target_path = None
     target = None
 
@@ -722,32 +723,31 @@
 
 class depend(null_relocatable):
     depend_on = None
-    child_type = None
     
     def __init__(self, depend_on):
         self.depend_on = depend_on
         pass
 
-    def __call__(self, child_type):
-        self.child_type = child_type
+    def __call__(self, back_type):
+        self.back_type = back_type
         return self
 
     def parse(self, parent, data, off):
-        v = self.child_type.parse(parent, data, off)
+        v = self.back_type.parse(parent, data, off)
         return v
 
     def sizeof(self, v):
-        v = self.child_type.sizeof(v)
+        v = self.back_type.sizeof(v)
         return v
 
     def compute_size(self, child):
-        if issubclass(self.child_type, relocatable):
-            self.child_type.compute_size(child)
+        if issubclass(self.back_type, relocatable):
+            self.back_type.compute_size(child)
             pass
         pass
 
     def to_str(self, child):
-        return self.child_type.to_str(child)
+        return self.back_type.to_str(child)
     pass