[sugar] how does an activity connect to the journal?

Paul Fox pgf
Thu Feb 28 09:10:01 EST 2008


i wrote:
 > where is the interface between activities and the journal
 > documented?  i'm not coming up with anything concrete when i
 > search the wiki.  (or alternatively, i'm coming up with too much
 > to wade through.)

two people have suggested (offlist, presumably to save me
embarrassment ;-) that i look more closely at:
    http://wiki.laptop.org/go/Low-level_Activity_API

certainly this page answers my questions about the X properties that
are being set in the preload library.

both referrers asked if there were things missing from that page. 
i'll try and comment on what i think could help someone like me.

i do feel like that there could be more of a broad-brush
overview, something like a "Lifetime of an Activity" section,
that would describe the interactions of an activity with the
various other sugar services, from start to finish.  this would
put the various piece parts of the api in context.  i've looked
(mostly via backlinks from this page) for such an overview, but
haven't found it.

maybe much of what i need is there and i'm just not seeing it. 
i get more from the wiki pages every time i read them, and i'm
handicapped by not being a python guy -- remember that i'm
porting an existing non-python, non-DBUS-aware app, and just
trying to make it run the best it can.  but i also think it's
typical of a wiki that it concentrate on the details.

the "Dbus Methods" section starts with "An activity instance
needs to create a DBus service", but there's no indication of
"why?".  what specific user or system interactions will be
enabled by creating this service?  what specific things won't
work if i don't?  (also, a link to somehere describing how to
[figure out how to] create this service for non-python activities
might be useful here.)

 > my activity starts (and terminates) okay, and anything it emits
 > on stdout or stderr ends up in a log file under /home/olpc/.sugar
 > (so some things are working), and it appears on the "ring of
 > running apps", but it doesn't show up in the journal.

ah -- okay -- the "Datastore" section says my app must store its
complete state in the datastore, to let it show up in the journal.
but i'm not sure what "complete state" means -- that's pretty
daunting, esp. for a program that already saves a lot of state in
other ways.  is there a minimum that i need to do / can do?  and
this is all accessed via DBUS?  that's not completely clear from
the page text.  (and again, a pointer to how to figure out how
to access the datastore/journal from non-python languages might
be useful.)  

back to my logs:  naively, i thought that since my messages were
already being stored under ~/.sugar/default/logs/org.x.RoadMap-3.log,
that i'd be able to access them without much trouble from the
Journal.  but apparently that's not the case?

i guess this reminds me of something else -- for someone who's
fairly new at this, the correspondence between the concepts of
"Datastore" and "Journal" isn't obvious.  the wiki pages all talk
about the Datastore, but what the user sees is the Journal.  (i
think this hampered my initial searches, both when skimming pages
and when actually entering searches on the wiki.)

anyway -- thanks for the pointers -- i have a much better
understanding of what needs to be done, even if i still don't
know how to go about doing it. :-)  i hope my comments have been
helpful -- it should be pretty clear that i'm in no position to
make additions or updates to the wiki myself, at this point. 
i'll try and help where and when i can, however.

paul
=---------------------
 paul fox, pgf at foxharp.boston.ma.us (arlington, ma, where it's 16.7 degrees)



More information about the Sugar-devel mailing list