Seif Lotfy has proposed merging 
lp:~zeitgeist/zeitgeist/timerange_and_event_value_fix into lp:zeitgeist.

Requested reviews:
  Zeitgeist Framework Team (zeitgeist)


I fixed the TimeRange.always to be consistent: so instead of (-maxint, maxint) 
it has become (0, maxint)

Also I check for values of the Event constructor new_for_values to detect 
faulty arguments and raise an exception
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/timerange_and_event_value_fix/+merge/32574
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~zeitgeist/zeitgeist/timerange_and_event_value_fix into lp:zeitgeist.
=== modified file 'zeitgeist/datamodel.py'
--- zeitgeist/datamodel.py	2010-07-28 20:10:07 +0000
+++ zeitgeist/datamodel.py	2010-08-13 12:12:44 +0000
@@ -377,7 +377,7 @@
 		Return a :class:`TimeRange` from the furtest past to the most
 		distant future
 		"""
-		return cls(-cls._max_stamp, cls._max_stamp)
+		return cls(0, cls._max_stamp)
 	
 	def is_always(self):
 		"""
@@ -701,6 +701,11 @@
 		
 		"""
 		self = cls()
+		for key in values.keys():
+			if not key in ("timestamp", "interpretation", 
+						"manifestation", "actor", "subjects"):
+				raise ValueError("Event parameter '%s' is not supported" %key)
+			
 		self.timestamp = values.get("timestamp", self.timestamp)
 		self.interpretation = values.get("interpretation", "")
 		self.manifestation = values.get("manifestation", "")

_______________________________________________
Mailing list: https://launchpad.net/~zeitgeist
Post to     : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp

Reply via email to