[Sugar-devel] Problem listing journal objects
Jim Simmons
nicestep at gmail.com
Mon Aug 17 10:45:49 EDT 2009
I was hoping I'd get an answer on this question but I haven't heard
anything yet. Last week I added features to View Slides including
Annotations (like Read Etexts has, without the highlighting) and
improved the ability of the Slides toolbar to add and remove images
from the slide show. I made it much more robust and added the ability
to extract images in a slideshow to create entries in the Journal.
I'd like to release this version soon.
As it is, not being able to list out images on thumb drives when they
are in subdirectories severely limits the usefulness of the Activity.
There is a limit to how many files you can store in the root
directory of a thumb drive formatted in the usual way.
So the question is, is my code wrong, or is it just not possible to do
what I want to do with the current API? If the latter I'll open a
ticket.
Thanks,
James Simmons
On Fri, Aug 14, 2009 at 11:17 AM, Jim Simmons<nicestep at gmail.com> wrote:
> In View Slides I have some code that lists out what image files it
> finds in the Journal and puts the results in a table, with the idea
> that these images may be added to a slide show. Until now I have been
> just putting image files in the root directory of a thumb drive and
> have been using the code below to list them:
>
> ds_objects, num_objects =
> datastore.find({'mime_type':['image/jpeg', 'image/gif', 'image/tiff',
> \
> 'image/png']}, 'title')
> for i in xrange (0, num_objects, 1):
> iter = self.ls_right.append()
> self.ls_right.set(iter, COLUMN_IMAGE,
> ds_objects[i].metadata['title'])
> self.ls_right.set(iter, COLUMN_PATH, ds_objects[i])
>
> Now this works, but there is a limit to how many files you can put in
> a thumb drive root. I decided to make subdirectories in the thumb
> drive and put images in each. As far as the Journal Activity itself
> is concerned this works fine. I have no problem seeing my image files
> in the Journal Activity when it is pointing to the thumb drive.
> However, I do not get a listing of the stuff in the thumb drive with
> this code, unless the picture is in the root directory of the thumb
> drive.
>
> Obviously there is a way to list out these images since the Journal
> can do it. So what am I missing here?
>
> Thanks,
>
> James Simmons
>
More information about the Sugar-devel
mailing list