Journal integration doubt
Tomeu Vizoso
tomeu at tomeuvizoso.net
Sun Oct 21 07:26:46 EDT 2007
On Sun, 2007-10-21 at 16:40 +0530, Arjun Sarwal wrote:
> I am trying to associate a simple text file with the journal object.
> Within a logging session of Measure activity, many logs are created
> and the file that I am trying to associate with the journal object
> would basically contain the file paths of the logs made in that
> session so that when the session is resumed from the journal those log
> files can be opened and displayed on the oscilloscope like interface.
>
> The seperate log files get created and written properly. However, I am
> facing problems regarding the main file that I try and associate with
> the Journal object. This file does get created but disappears when I
> quit the activity. I have attached relevant code portions below.
>
> Please point me to some code that might be doing something similar to
> what I am trying to do or let me know where I am going wrong.
I see you case similar to what Record does, here is the code:
http://www.mediamods.com/public-svn/camera-activity/tags/33/
Most python activities just have to implement the read_file and
write_file methods in their Activity subclass. Record is a bit more
complicated, because apart from the session data, it also creates an
object in the journal for every photograph and every recording, so they
can be dragged around or opened with other activities.
In your case, if you don't need to make each individual log accessible
to other activities, you could just write a zip file containing all your
logs in the write_file method. In this case, see this example activity
from Marco:
git-clone http://dev.laptop.org/~marco/edit-activity/
Hope this helps,
Tomeu
More information about the Devel
mailing list