scratch team mailing list archive
-
scratch team
-
Mailing list archive
-
Message #00074
Re: Debug - import a costume using journal widget
Thanks Claudia!
This is very helpful. Both the logs show the same problem.
I have an idea for a workaround, but there may be a deeper problem, because you said the simple interface did not work either. So could you also get me a log where you try the Scratch interface, not the shift-click Dialog?
And which Sugar version / OLPC release are you using?
You can safely ignore the rest of this message. But if you want to learn how to read the log and understand what's going on, read ahead.
> received Signal DBus.NameAcquired(':1.13')
We just connected to DBus and are told our service name. There are symbolic and numeric names - similar to DNS names and IP addresses. Other DBus clients will send us messages or replies using this name (we did not register a symbolic name yet).
> sent Journal.ChooseObject('Image')
> received Error
This tries the Sugar 0.84 interface first which allows to pre-select a media type. Since this is an earlier Sugar version we get an error back - safe to ignore.
> sent Journal.ChooseObject()
> received '3016d6105f4e48df8310803f188e3ff5'
We try again using the old interface, which succeeds. Journal shows dialog, we get the dialog id back. Then we register a match to receive a signal when the user selects something or cancels (the registering itself is not logged).
> received Signal Journal.ObjectChooserResponse('3016d6105f4e48df8310803f188e3ff5', 'c01a1d86-db77-495a-8790-7074912493ed'
That's the signal - the user chose object 'c01a1d86-db77-495a-8790-7074912493ed'. We proceed to unregister the match (which again is not logged).
> send DataStore.get_properties('c01a1d86-db77-495a-8790-7074912493ed')
> received (... 'title'->'Screenshot' ... 'mime_type'->'image/png' ...)
We ask the datastore for the object's meta data and get back its title and mime type, amongst others.
> sent DataStore.find(['uid'->'c01a1d86-db77-495a-8790-7074912493ed'], ['uid' 'title' 'mime_type'])
> received ([], 0)
This is where it fails. This should not have answered an empty list but one just containing our object.
We need the list because of a kludge I had to use. Scratch's file dialog assumes there is a currentDirectory and in its list there is one item selected. That is what will be returned once the user clicks OK. So I just set a fake SugarDirectory as current and select its only item, then return normally from the dialog, which avoids adding lots of special-case code. And that directory does the find() call above which should return a 1-item list, but for some odd reason does not.
I can avoid doing the find() call here because we actually already retrieved the meta data. It's still odd that this is failing.
- Bert -
On 25.02.2010, at 04:55, Claudia Urrea wrote:
>
> Hi Bert,
>
> I had a full day of work and meetings. i have time now to open my xo
> again (writing from my xo).
>
> I am including the debbud messages from importing a costume using
> journal widget. I will do the same for the import project test (I still
> can't get it to work).
>
> Best,
>
> Claudia
>
> ---------------
> DBus sessionBus received DBusMessageSignal(2)[/org/freedesktop/DBus
> org.freedesktop.DBus.NameAcquired(DBusArgument(s)[':1.13'])]
> DBus sessionBus sent DBusMessageMethodCall[/org/laptop/Journal
> org.laptop.Journal.ChooseObject(DBusArgument(i)[0],
> DBusArgument(s)['Image'])]
> DBus sessionBus received
> DBusMessageError['org.freedesktop.DBus.Python.TypeError'('Traceback
> (most recent call last):
> File "/usr/lib/python2.5/site-packages/dbus/service.py", line 702,
> in _message_cb
> retval = candidate_method(self, *args, **keywords)
> TypeError: ChooseObject() takes exactly 2 arguments (3 given)
> ')]
> DBus sessionBus sent DBusMessageMethodCall[/org/laptop/Journal
> org.laptop.Journal.ChooseObject(DBusArgument(i)[0])]
> DBus sessionBus received DBusMessageMethodReply(114)[?
> ?(DBusArgument(s)['3016d6105f4e48df8310803f188e3ff5'])] to (3)
> DBus sessionBus received DBusMessageSignal(116)[/org/laptop/Journal
> org.laptop.Journal.ObjectChooserResponse(DBusArgument(s)['3016d6105f4e48df8310803f188e3ff5'],
> DBusArgument(s)['c01a1d86-db77-495a-8790-7074912493ed'])]
> DBus sessionBus sent DBusMessageMethodCall[/org/laptop/sugar/DataStore
> org.laptop.sugar.DataStore.get_properties(DBusArgument(s)['c01a1d86-db77-495a-8790-7074912493ed'])]
> DBus sessionBus received DBusMessageMethodReply(20)[?
> ?(DBusArgument(a{sv})[(DBusArgument({sv})[DBusArgument(s)['activity_id']->DBusArgument(v)[DBusArgument(s)['']]]
> DBusArgument({sv})[DBusArgument(s)['title_set_by_user']->DBusArgument(v)[DBusArgument(s)['']]]
> DBusArgument({sv})[DBusArgument(s)['activity']->DBusArgument(v)[DBusArgument(s)['']]]
> DBusArgument({sv})[DBusArgument(s)['vid']->DBusArgument(v)[DBusArgument(d)[1.0]]]
> DBusArgument({sv})[DBusArgument(s)['title']->DBusArgument(v)[DBusArgument(s)['Screenshot']]]
> DBusArgument({sv})[DBusArgument(s)['timestamp']->DBusArgument(v)[DBusArgument(i)[1266981495]]]
> DBusArgument({sv})[DBusArgument(s)['buddies']->DBusArgument(v)[DBusArgument(s)['']]]
> DBusArgument({sv})[DBusArgument(s)['keep']->DBusArgument(v)[DBusArgument(i)[0]]]
> DBusArgument({sv})[DBusArgument(s)['icon-color']->DBusArgument(v)[DBusArgument(s)['#B20008,#00EA11']]]
> DBusArgument({sv})[DBusArgument(s)['mtime']->DBusArgument(v)[DBusArgument(s)['2010-02-24T03:18:15']]]
> DBusArgument({sv})[DBusArgument(s)['mountpoint']->DBusArgument(v)[DBusArgument(s)['/home/olpc/.sugar/default/datastore']]]
> DBusArgument({sv})[DBusArgument(s)['preview']->DBusArgument(v)[DBusArgument(ay)[a
> ByteArray()]]] DBusArgument({sv})[DBusArgument(s)['mime_type']->DBusArgument(v)[DBusArgument(s)['image/png']]])])]
> to (8)
> DBus sessionBus sent DBusMessageMethodCall[/org/laptop/sugar/DataStore
> org.laptop.sugar.DataStore.find(DBusArgument(a{sv})[('uid'->'c01a1d86-db77-495a-8790-7074912493ed')],
> DBusArgument(as)[('uid' 'title' 'mime_type')])]
> DBus sessionBus received DBusMessageMethodReply(21)[?
> ?(DBusArgument(aa{sv})[()], DBusArgument(u)[0])] to (9)