[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist

2010-08-30 Thread Seif Lotfy
The proposal to merge lp:~zeitgeist/zeitgeist/datasource-properties-fix into 
lp:zeitgeist has been updated.

Status: Needs review => Merged
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/datasource-properties-fix/+merge/33775
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/datasource-properties-fix.

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


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist

2010-08-30 Thread Mikkel Kamstrup Erlandsen
Review: Approve
Looks good. I didn't actually run the unit tests but the diff is clean enough 
that I don't think regressions are a big danger here.

Nice work!
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/datasource-properties-fix/+merge/33775
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/datasource-properties-fix.

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


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist

2010-08-26 Thread Markus Korn
Review: Needs Fixing

-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/datasource-properties-fix/+merge/33775
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist.

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


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist

2010-08-26 Thread Markus Korn
So far so good, but this new properties should be used in the existing code, 
otherwise they are pretty much useless ;)

http://pastebin.ubuntu.com/484135/ has a few bits where the new properties 
should be used

I guess some properties also need to be writable...
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/datasource-properties-fix/+merge/33775
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist.

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


[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist

2010-08-26 Thread Seif Lotfy
Seif Lotfy has proposed merging 
lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist.

Requested reviews:
  Zeitgeist Framework Team (zeitgeist)


This is a fix for 
https://bugs.edge.launchpad.net/zeitgeist/+bug/513295
pretty straight forward
tested in the Registry Extension Directly (removed code before commit)
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/datasource-properties-fix/+merge/33775
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~zeitgeist/zeitgeist/datasource-properties-fix into lp:zeitgeist.
=== modified file 'zeitgeist/datamodel.py'
--- zeitgeist/datamodel.py	2010-08-16 18:42:52 +
+++ zeitgeist/datamodel.py	2010-08-26 13:08:43 +
@@ -4,7 +4,7 @@
 #
 # Copyright © 2009 Mikkel Kamstrup Erlandsen 
 # Copyright © 2009 Markus Korn 
-# Copyright © 2009 Seif Lotfy 
+# Copyright © 2009-2010 Seif Lotfy 
 # Copyright © 2009-2010 Siegfried-Angel Gevatter Pujals 
 #
 # This program is free software: you can redistribute it and/or modify
@@ -381,10 +381,10 @@
 	
 	def is_always(self):
 		"""
-		Returns True if this time range goes from timestamp 0 (January 1, 1970)
-		-or lower- to the most distant future.
+		Returns True if this time range represents the 0 (January 1, 1970) to the most
+		distant future
 		"""
-		return self.begin <= 0 and self.end >= TimeRange._max_stamp
+		return self.begin == 0 and self.end >= TimeRange._max_stamp
 		
 	def intersect(self, time_range):
 		"""
@@ -483,8 +483,8 @@
 		self = Subject()
 		for key, value in values.iteritems():
 			if not key in ("uri", "interpretation", "manifestation", "origin",
-"mimetype", "text", "storage"):
-raise ValueError("Subject parameter '%s' is not supported" % key)
+		"mimetype", "text", "storage"):
+raise ValueError("Subject parameter '%s' is not supported" %key)
 			setattr(self, key, value)
 		return self
 		
@@ -705,9 +705,9 @@
 		"""
 		self = cls()
 		for key in values:
-			if not key in ("timestamp", "interpretation", "manifestation",
-"actor", "subjects"):
-raise ValueError("Event parameter '%s' is not supported" % key)
+			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", "")
@@ -928,6 +928,35 @@
 	def __repr__(self):
 		return "%s: %s (%s)" % (self.__class__.__name__, self[self.UniqueId],
 			self[self.Name])
+	
+	@property
+	def unique_id(self):
+		return self[self.UniqueId]
+	
+	@property
+	def name(self):
+		return self[self.Name]
+	
+	@property
+	def description(self):
+		return self[self.Description]
+	
+	@property
+	def templates(self):
+		return self[self.EventTemplates]
+	
+	@property
+	def running(self):
+		return self[self.Running]
+	
+	@property
+	def last_seen(self):
+		return self[self.LastSeen]
+	
+	@property
+	def enabled(self):
+		return self[self.Enabled]
+	
 
 NULL_EVENT = ([], [], [])
 """Minimal Event representation, a tuple containing three empty lists.

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