Add __contains__
to arch to satsify old packages.
This commit is contained in:
parent
3fcd54203c
commit
c90cc465f5
1 changed files with 9 additions and 2 deletions
|
@ -206,12 +206,15 @@ def detect(self):
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return self.__str__()
|
return self.__str__()
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
def _cmp_key(self):
|
def _cmp_key(self):
|
||||||
t_keys = ''.join(str(t._cmp_key()) for t in
|
t_keys = ''.join(str(t._cmp_key()) for t in
|
||||||
sorted(self.targets.values()))
|
sorted(self.targets.values()))
|
||||||
|
@ -338,7 +341,6 @@ def to_dict(self):
|
||||||
d = {}
|
d = {}
|
||||||
d['name'] = self.name
|
d['name'] = self.name
|
||||||
d['version'] = self.version
|
d['version'] = self.version
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
@key_ordering
|
@key_ordering
|
||||||
|
@ -378,6 +380,11 @@ def __str__(self):
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
def __contains__(self, string):
|
||||||
|
return string in str(self)
|
||||||
|
|
||||||
|
|
||||||
def _cmp_key(self):
|
def _cmp_key(self):
|
||||||
if isinstance(self.platform, Platform):
|
if isinstance(self.platform, Platform):
|
||||||
platform = self.platform.name
|
platform = self.platform.name
|
||||||
|
|
Loading…
Reference in a new issue