[Sugar-devel] Problem listing journal objects

Jim Simmons nicestep at gmail.com
Fri Aug 14 12:17:31 EDT 2009


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