r7181 - online-desktop/trunk/pyddm/ddm



Author: otaylor
Date: 2008-01-10 13:12:56 -0600 (Thu, 10 Jan 2008)
New Revision: 7181

Modified:
   online-desktop/trunk/pyddm/ddm/DataModel.py
Log:
Very simple feed support for Python data model ...just represent a feed as a list of (resource,timestamp) tuples

Modified: online-desktop/trunk/pyddm/ddm/DataModel.py
===================================================================
--- online-desktop/trunk/pyddm/ddm/DataModel.py	2008-01-10 18:54:51 UTC (rev 7180)
+++ online-desktop/trunk/pyddm/ddm/DataModel.py	2008-01-10 19:12:56 UTC (rev 7181)
@@ -168,6 +168,13 @@
                 value = self._get_resource(value)
             except KeyError:
                 raise Exception("Resource-valued element points to a resource we don't know about: " + str(value))
+        elif type_byte == ord('F'):
+            item_resource_id, item_timestamp = value
+            try:
+                item_resource = self._get_resource(item_resource_id)
+            except KeyError:
+                raise Exception("Feed-valued element points to a resource we don't know about: " + str(value))
+            value = item_resource, int(item_timestamp)
         elif type_byte == ord('s') or type_byte == ord('u'):
             value = unicode(value)
         elif type_byte == ord('b'):



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