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
|
@ -195,7 +195,7 @@ def operating_system(self, name):
|
|||
name = self.back_os
|
||||
|
||||
return self.operating_sys.get(name, None)
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def detect(self):
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue