1) Make sure odccm is NOT running
2) Start synce-gnome/src/test.py
What happens: Python spits some unreadable dump. (It is a stack trace,
since odccm is not connected to d-bus, so binding to d-bus name
org.synce.odccm fails.)
Traceback (most recent call last):
File "synce/synce-gnome.cleaned/src/test.py", line 130, in <module>
TestApp()
File "synce/synce-gnome.cleaned/src/test.py", line 14, in __init__
proxy_obj = bus.get_object("org.synce.odccm",
"/org/synce/odccm/DeviceManager")
File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 410, in
get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 230,
in __init__
_dbus_bindings.UInt32(0))
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 169,
in __call__
reply_message =
self._connection.send_message_with_reply_and_block(message, timeout)
dbus.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The
name org.synce.odccm was not provided by any .service files
This is unreadable to user. Some people say user should not be to
crash program, be it wrong access to memory, assertion or exception.
If it makes no sense to continue it is OK to exit, but some user
readable explanation is a must, additional debugging info is then
aceptable.
This patch says that odccm must be running.
If user does not know what synce-gnome does and device is not
connected, he/she may be surprised it does nothing (in user
interaction sense). Therefore this patch displays "Plug your device
in" or something.
--
/Petr4
Index: synce-gnome/src/test.py
===================================================================
--- synce-gnome/src/test.py (revision 3029)
+++ synce-gnome/src/test.py (working copy)
@@ -11,7 +11,12 @@
bus = dbus.SystemBus()
self.bus = bus
- proxy_obj = bus.get_object("org.synce.odccm", "/org/synce/odccm/DeviceManager")
+ try:
+ proxy_obj = bus.get_object("org.synce.odccm", "/org/synce/odccm/DeviceManager")
+ except dbus.DBusException:
+ print "Error: Could not connect to synce-odccm daemon, is it started?"
+ raise
+
mgr = dbus.Interface(proxy_obj, "org.synce.odccm.DeviceManager")
mgr.connect_to_signal("DeviceConnected", self.device_connected_cb)
@@ -23,6 +28,8 @@
for obj_path in mgr.GetConnectedDevices():
self._add_device(obj_path, False)
+
+ print "Waiting for device to hotplug"
def device_connected_cb(self, obj_path):
self._add_device(obj_path, True)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel