Cosmetics

This commit is contained in:
Guillaume Ayoub 2013-10-29 09:30:51 +01:00
parent e5b578d219
commit 337d2719be

View File

@ -110,9 +110,9 @@ class Item(object):
"\nEND:", "\nX-RADICALE-NAME:%s\nEND:" % self._name) "\nEND:", "\nX-RADICALE-NAME:%s\nEND:" % self._name)
def __hash__(self): def __hash__(self):
m = hashlib.md5() md5 = hashlib.md5()
m.update(self.text.encode('utf-8')) md5.update(self.text.encode("utf-8"))
return m.hexdigest() return md5.hexdigest()
def __eq__(self, item): def __eq__(self, item):
return isinstance(item, Item) and self.text == item.text return isinstance(item, Item) and self.text == item.text
@ -440,9 +440,9 @@ class Collection(object):
@property @property
def etag(self): def etag(self):
"""Etag from collection.""" """Etag from collection."""
m = hashlib.md5() md5 = hashlib.md5()
m.update(self.text.encode('utf-8')) md5.update(self.text.encode("utf-8"))
return '"%s"' % m.hexdigest() return '"%s"' % md5.hexdigest()
@property @property
def name(self): def name(self):