projects
/
pycalendar.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d6479b
)
entry: Hash entries by their UID (when possible)
author
W. Trevor King
<wking@tremily.us>
Sun, 30 Jun 2013 18:14:08 +0000
(14:14 -0400)
committer
W. Trevor King
<wking@tremily.us>
Sun, 30 Jun 2013 20:24:29 +0000
(16:24 -0400)
From RFC 5545, section 3.8.4.7 (Unique Identifier):
Conformance: The property MUST be specified in the "VEVENT",
"VTODO", "VJOURNAL", or "VFREEBUSY" calendar components.
pycalendar/entry.py
patch
|
blob
|
history
diff --git
a/pycalendar/entry.py
b/pycalendar/entry.py
index 90e0bac0b060cf64c301abf86b9346fa60bc9a74..315a2284080607f36ca061d45619dc3c966d4a63 100644
(file)
--- a/
pycalendar/entry.py
+++ b/
pycalendar/entry.py
@@
-69,6
+69,13
@@
class Entry (dict):
self.process()
def __hash__(self):
+ if self.type in [
+ 'VEVENT',
+ 'VFREEBUSY',
+ 'VJOURNAL',
+ 'VTODO',
+ ] or 'UID' in self:
+ return hash(_text.unescape(self['UID']))
return id(self)
def __str__(self):