conduit r1814 - in trunk: . conduit/datatypes



Author: jstowers
Date: Tue Jan 20 01:28:01 2009
New Revision: 1814
URL: http://svn.gnome.org/viewvc/conduit?rev=1814&view=rev

Log:
2009-01-20  John Stowers  <john stowers gmail com>

	* conduit/datatypes/Event.py: Ignore certain fields in the
	Event vcal data because it changes the hash.
	Fixes #564144 (Brian Teague)



Modified:
   trunk/ChangeLog
   trunk/conduit/datatypes/Event.py

Modified: trunk/conduit/datatypes/Event.py
==============================================================================
--- trunk/conduit/datatypes/Event.py	(original)
+++ trunk/conduit/datatypes/Event.py	Tue Jan 20 01:28:01 2009
@@ -26,4 +26,11 @@
         DataType.DataType.__setstate__(self, data)
         
     def get_hash(self):
-        return str(hash(self.get_ical_string()))
+        ical_string = self.get_ical_string()
+        p = re.compile('CREATED:.*\n')
+        ical_string = p.sub( '', ical_string )
+        p = re.compile('LAST-MODIFIED:.*\n')
+        ical_string = p.sub( '', ical_string )
+        p = re.compile('UID:.*\n')
+        ical_string = p.sub( '', ical_string )
+        return str(hash(ical_string))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]