online-desktop r7239 - in trunk/pyddm: . ddm



Author: otaylor
Date: Sun Jan 27 19:38:24 2008
New Revision: 7239
URL: http://svn.gnome.org/viewvc/online-desktop?rev=7239&view=rev

Log:
Increase verbosity of "points to an unknown resource" error messages.
Work around missing defaultChildren for contactDMO.user (now fixed)
  by requesting contacts [+;user +].


Modified:
   trunk/pyddm/ddm/DataModel.py
   trunk/pyddm/test-session.py

Modified: trunk/pyddm/ddm/DataModel.py
==============================================================================
--- trunk/pyddm/ddm/DataModel.py	(original)
+++ trunk/pyddm/ddm/DataModel.py	Sun Jan 27 19:38:24 2008
@@ -167,13 +167,13 @@
             try:
                 value = self._get_resource(value)
             except KeyError:
-                raise Exception("Resource-valued element points to a resource we don't know about: " + str(value))
+                raise Exception("Resource-valued element for %s#%s points to a resource we don't know about: %s" % (property_uri, property_name, 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))
+                raise Exception("Feed-valued element for %s#%s points to a resource we don't know about: %s" % (property_uri, property_name, value))
             value = item_resource, int(item_timestamp)
         elif type_byte == ord('s') or type_byte == ord('u'):
             value = unicode(value)

Modified: trunk/pyddm/test-session.py
==============================================================================
--- trunk/pyddm/test-session.py	(original)
+++ trunk/pyddm/test-session.py	Sun Jan 27 19:38:24 2008
@@ -33,7 +33,7 @@
     buddy._dump()
 
 def on_buddies_changed(global_resource):
-    for buddy in global_resource.onlineBuddies:
+    for buddy in getattr(global_resource, 'onlineBuddies', []):
         buddy.disconnect(on_buddy_changed) # In case we connected previously
         buddy.connect(on_buddy_changed)
         on_buddy_changed(buddy)
@@ -52,7 +52,7 @@
     print "Ready"
 
     if model.self_resource != None:
-        query = model.query_resource(model.self_resource, "+;contacts +;contacters +;lovedAccounts +;email;aim")
+        query = model.query_resource(model.self_resource, "+;contacts [+;user +];contacters +;lovedAccounts +;email;aim")
         query.add_handler(on_self_query_success)
         query.add_error_handler(on_self_query_failure)
         query.execute()



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