[Sugar-devel] Some questions concerning saving methods on sugar

Sascha Silbe sascha-ml-reply-to-2010-3 at silbe.org
Fri Sep 24 13:05:48 EDT 2010


Excerpts from Alberto Arruda de Oliveira's message of Thu Sep 23 00:58:18 +0200 2010:

> Although it's not working perfectly yet, I hope it will be soon. I'm just
> having a little problem with the keep button. My activity creates the
> journal entry like it should when I exit through the close button, but when
> I press the keep button, it doesn't create the entry. Is there any big
> differences in how the keep and close button access the journal to save the
> state of the activity?

It's hard to say anything definitive without looking at the code of your
activity. If you use the activity framework provided by sugar-toolkit
(especially the sugar.activity.activity.Activity class) and implement
both read_file() and write_file(), then Keep should work just fine. All
it does is to save the entry and cause a new object_id to be assigned on
next save (which will happen on Stop or switching away from the
activity).

> Also, related to the sugar-emulator, sometimes, when I close it, all the
> journal entries are wiped.

Uh, that's pretty bad. Are you sure the entries are gone, or will they
reappear when you restart Sugar (i.e. sugar-emulator)?

If the former, please file a bug [2] and create a tarball of ~/.sugar
the next time it happens:

tar -C "$HOME" -cjf sugar-datastore-cleared.tar.bz2 .sugar

If you used Sugar for anything else than testing your activity, you
can send me that tarball privately (it will contain a private key used
for collaboration and probably all of your Journal entries as well as
temporary / cached files from e.g. Browse).

Sascha

[1] http://git.sugarlabs.org/projects/sugar-toolkit/repos/mainline/blobs/master/src/sugar/activity/activity.py#line676
[2] https://bugs.sugarlabs.org/newticket?component=sugar-datastore&severity=Critical
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100924/3938369c/attachment.pgp 


More information about the Sugar-devel mailing list