On Thu, Mar 6, 2008 at 2:06 AM, Benjamin M. Schwartz <[EMAIL PROTECTED]> wrote: > Tomeu Vizoso wrote: > | On Sat, Mar 1, 2008 at 6:44 AM, Benjamin M. Schwartz > | <[EMAIL PROTECTED]> wrote: > |> I ask because I am writing a trivial "Distribute" Activity, whose purpose > |> is to copy journal entries from one XO to another by sharing. This is > |> working, but since the copy does not have any metadata, like MIME type, > it > |> cannot be opened from the Journal interface by any Activity except > |> Distribute, which created it. > |> > |> Ideally, I would like to acquire the metadata as a dbus object, so that I > |> may simply shove it over a DBus Tube and then pass it on to the > receiver's > |> datastore. > | > | What if you serialize the whole entry (file + metadata) inside a zip > | file and distribute that? > | > | http://wiki.laptop.org/go/Journal_entry_bundles > | > | The journal has already support for installing to the DS these > | serialized entries: > | > | http://dev.laptop.org/git?p=journal-activity;a=blob;f=journalentrybundle.py > | > | Added because of http://dev.laptop.org/ticket/4380 . > > This sounds perfect. In Activity code, how do a I get a > journal-entry-bundle from a datastore objectid, or datastore file path?
Well, the creation of the entry bundle was going to be generated by the backup component in the school server. I don't know if Ivan got to that part. But serializing the metadata dict according to the spec is certainly trivial, you can see an example in the part of the backup system that serializes the metadata before rsync'ing to the school server: http://tinyurl.com/2wqk9u http://dev.laptop.org/git?p=users/krstic/ds-backup;a=blob;f=ds_backup.py;h=a1fb11f9f6d431b0d134242f2296b743c4435d25;hb=HEAD#l53 If you decide to use this format, perhaps you could contribute this code to the sugar toolkit? Or well, more generally, do you mind if I steal your code when we implement entry sharing in the journal? Thanks, Tomeu _______________________________________________ Sugar mailing list [email protected] http://lists.laptop.org/listinfo/sugar

