Automatically fixup rank for any component pulled in due to dependency from a low...
authorIlpo Ruotsalainen <ilpo.ruotsalainen@movial.fi>
Mon, 20 Oct 2008 13:41:54 +0000 (16:41 +0300)
committerIlpo Ruotsalainen <ilpo.ruotsalainen@movial.fi>
Mon, 20 Oct 2008 13:41:54 +0000 (16:41 +0300)
matrix/components.py

index 7f67037..72f7217 100644 (file)
@@ -58,6 +58,11 @@ class Component(object):
                return self.__dirty
 
        def add_depend(self, c):
+               if self.rank < c.rank:
+                       c.rank = self.rank
+                       if config.debug:
+                               print 'Rank fixup:', c, 'inherits rank from', self
+
                self.depends.add(c)
 
        def remove_depend(self, c):