diff options
Diffstat (limited to 'indra/lib/python/indra/ipc/compatibility.py')
-rwxr-xr-x | indra/lib/python/indra/ipc/compatibility.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/indra/lib/python/indra/ipc/compatibility.py b/indra/lib/python/indra/ipc/compatibility.py index b9045c22f3..d6ab4f15d5 100755 --- a/indra/lib/python/indra/ipc/compatibility.py +++ b/indra/lib/python/indra/ipc/compatibility.py @@ -32,7 +32,7 @@ $/LicenseInfo$ I M O N S -- -- -- -- -- I: I I I I I -M: I M M M M +M: I M M M M O: I M O M O N: I M M N N S: I M O N S @@ -44,31 +44,31 @@ class _Compatibility(object): self.reasons = [ ] if reason: self.reasons.append(reason) - + def combine(self, other): if self._level() <= other._level(): return self._buildclone(other) else: return other._buildclone(self) - + def prefix(self, leadin): - self.reasons = [ leadin + r for r in self.reasons ] - + self.reasons = [ leadin + r for r in self.reasons ] + def same(self): return self._level() >= 1 def deployable(self): return self._level() > 0 def resolved(self): return self._level() > -1 def compatible(self): return self._level() > -2 - + def explain(self): return self.__class__.__name__ + "\n" + "\n".join(self.reasons) + "\n" - + def _buildclone(self, other=None): c = self._buildinstance() c.reasons = self.reasons if other: c.reasons = c.reasons + other.reasons return c - + def _buildinstance(self): return self.__class__(None) @@ -85,10 +85,10 @@ class Mixed(_Compatibility): _Compatibility.__init__(self, None) for i in inputs: self.reasons += i.reasons - + def _buildinstance(self): return self.__class__() - + def _level(self): return -1 @@ -103,7 +103,7 @@ class _Aged(_Compatibility): class Older(_Aged): def _level(self): return -0.25 - + class Newer(_Aged): def _level(self): return 0.25 @@ -111,10 +111,10 @@ class Newer(_Aged): class Same(_Compatibility): def __init__(self): _Compatibility.__init__(self, None) - + def _buildinstance(self): return self.__class__() - + def _level(self): return 1 |