Add __contains__ to arch to satsify old packages.

This commit is contained in:
Todd Gamblin 2016-06-16 00:54:59 -07:00
parent 3fcd54203c
commit c90cc465f5

View file

@ -206,12 +206,15 @@ def detect(self):
"""
raise NotImplementedError()
def __repr__(self):
return self.__str__()
def __str__(self):
return self.name
def _cmp_key(self):
t_keys = ''.join(str(t._cmp_key()) for t in
sorted(self.targets.values()))
@ -338,7 +341,6 @@ def to_dict(self):
d = {}
d['name'] = self.name
d['version'] = self.version
return d
@key_ordering
@ -378,6 +380,11 @@ def __str__(self):
else:
return ''
def __contains__(self, string):
return string in str(self)
def _cmp_key(self):
if isinstance(self.platform, Platform):
platform = self.platform.name