Re: [Sugar-devel] Problem listing journal objects
On Tue, Aug 18, 2009 at 23:47, Sascha Silbesascha-ml-ui-sugar-de...@silbe.org wrote: On Tue, Aug 18, 2009 at 03:13:22PM -0500, Jim Simmons wrote: [Accessing files on external media from within an activity] Is there some backward compatible way to do what I want to do? Or if I wanted to do it specifically for .84 and didn't care about .82 how would I do that? I'm afraid there isn't a public API to do that for 0.84+ (only Journal internal ones, see jarabe.journal.model). I don't know whether that's on purpose or not, but Tomeu should be able to tell. The public API is the POSIX one, though I don't know how this will be affected by future versions of Rainbow. Regards, Tomeu CU Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iQEcBAEBAgAGBQJKiyF4AAoJELpz82VMF3Da3esIAJX/9+JKHj85R/a2iOWAZMl4 wviMAa7XYf/cfSqethcNTX4RTJrwkRUTrYLrg29xdoQmrBuj6ip6mON0M1EUrbKg SNCjOQQQho8W7V42uKBtBd1vOkDmW3/LFskEqYTFJe5XBwB1BZrZ9y1F/eHaHDzd 4TgI1pCVgFHCU5F44Wkr1R/AZUrf4x8yShGmvSkfWH2Kz648VgX0PCU3SZFVB4Os O5TglnJuMsykeWnCm5WnoXEm9F2EC92NQa+faLrUWdw6DWSjEQH6FbTTVcNS5jWe 1j+4XlpSj7UIi+MiGtxIxxYU1IQh+/ng2zX33NKpJhtvNvnQsowD7ufll7T/Ois= =zCN8 -END PGP SIGNATURE- ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- «Sugar Labs is anyone who participates in improving and using Sugar. What Sugar Labs does is determined by the participants.» - David Farning ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Problem listing journal objects
Michael, What it sounds like to me is that I will get read-only access to /proc/mounts and to files and directories on removable media connected to the USB ports. I can use ordinary Python IO to list directories and read files and find out what is mounted. I can continue to use the datastore API for entries in the Journal. While I can create new entries in the Journal out of slides in my slide shows, I will not be able to copy them directly to thumb drives, etc. Any temporary files I need have to go in the instance subdirectory of my Activity. I won't be able to use the /temp directory in the future. Finally, if someone inserts a thumb drive after my Activity has started I won't be able to detect that drive. Please correct me on any of this I got wrong. Thanks, James Simmons [Accessing files on external media from within an activity] The public API is the POSIX one, though I don't know how this will be affected by future versions of Rainbow. 1. Pretty much everything that I know about the future of rainbow features is described at http://wiki.laptop.org/go/Rainbow/Next_Steps Thus, if you don't see answers to your questions already and if you care to formulate your question(s) a bit more precisely, I'll be happy to try to improve the page based on them. 2. I'm not aware of anything other than HAL and parsing /proc/mounts for finding interesting mount points. I personally tend to parse /proc/mounts. 3. Please be aware that contemporary versions of rainbow call clone(CLONE_NEWNS) or unshare(CLONE_NEWNS) which means that rainbow-isolated activities don't see mount-points added to Sugar's namespace after the activity is launched. Regards, Michael ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Problem listing journal objects
On Mon, Aug 17, 2009 at 09:45:49AM -0500, Jim Simmons 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') The support for mounted filesystems has moved from the data store to the Journal for 0.84+. I'm afraid your code can only list images inside the data store, but not on external media for non-0.82. CU Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: Digital signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Problem listing journal objects
At lunch today I tried out my latest View Slides on my XO for the first time and found that I *could* see all of the images with the code I was using. So it would seem to be an issue with the Sugar test environment that ships with Fedora 11 and 10, and not an issue with Sugar itself. I think. Also, the code to add an image to the slide show is broken on the XO but works fine in Fedora 10 and 11. So it looks like I don't have a question after all. James Simmons On Fri, Aug 14, 2009 at 11:17 AM, Jim Simmonsnices...@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 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Problem listing journal objects
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 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel