Commit bd18a174 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge branch 'serialisation'

parents 9f09b7b4 f1e4a501
...@@ -71,6 +71,8 @@ class BuildoutSerialiser(object): ...@@ -71,6 +71,8 @@ class BuildoutSerialiser(object):
'list': list, 'list': list,
'str': str, 'str': str,
'tuple': tuple, 'tuple': tuple,
'False': False,
'True': True,
}} }}
def loads(self, value): def loads(self, value):
...@@ -1599,6 +1601,20 @@ class Options(UserDict.DictMixin): ...@@ -1599,6 +1601,20 @@ class Options(UserDict.DictMixin):
""" """
return _convert_bool(name, self[name]) return _convert_bool(name, self[name])
def __eq__(self, other):
"""Because __cmp__ calls cmp(self, other)
and if self contains set instance, it fails.
"""
if isinstance(other, (UserDict.DictMixin, dict)):
for item_self, item_other in itertools.izip_longest(
self.iteritems(),
other.iteritems()):
if item_self != item_other:
return False
return True
else:
return super(Options, self).__eq__(other)
def _convert_bool(name, value): def _convert_bool(name, value):
if value not in ('true', 'false'): if value not in ('true', 'false'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment