---------- Forwarded message ---------- From: laurent bernabe <laurent.bern...@gmail.com> Date: 2011/5/30 Subject: Re: [Sugar-devel] Should or should not i use PyGTK >= 2.4 widget ? To: Walter Bender <walter.ben...@gmail.com>
Hello I come back to this discussion, because there is another obscure point in my mind => Is it possible to write a file to a usb key, though the tutorial says that there the activity can only acess its data/instance/temp folder ? Apologizes if my question is too evident and unusefull . But i don't feel yet ready for developping serailisation/sharing part of my app Regards 2011/5/29 laurent bernabe <laurent.bern...@gmail.com> > ok, thank you. > i'll have a look at the examples and try to find an example close to my > needs. > > regards > > > 2011/5/28 Walter Bender <walter.ben...@gmail.com> > >> >> >> On Sat, May 28, 2011 at 5:04 AM, laurent bernabe < >> laurent.bern...@gmail.com> wrote: >> >>> Thank you for your answers. >>> But i am not sure i can do my task just with an ObjectChooser. And i need >>> your advices for the strategy i should adopt : >>> >>> - I want my application to "save a graph" by writing the coordinates >>> in a text file => i am conviced that for this tasks, i should use the >>> folder >>> data of the activity >>> - i want my application to "load a graph" from a previously recorded >>> graph >>> - but i also want the users to share other graphs each others : more >>> precisely, for users who don't have internet access (or for later systems >>> restores, maybe after a crash, for example) to be able to import files >>> from >>> a usb key >>> >>> So, what is the best strategy in order to do these tasks and remain >>> conform to Sugar best practices ? >>> >> >> In general, using the Journal for these sorts of tasks is best practice in >> Sugar. You can set a file path with your data associated with your >> activity's datastore instance. That file can contain anything you want. It >> is typical to have a method that overrides the builtin write_file method -- >> called whenever the activity is either removed from the foreground or the >> activity exits -- from which you save data. >> >> def write_file(self, file_path): >> ''' Write the project to the Journal. ''' >> ... >> >> You can also set the mime type for this file, so as giving a hint as to >> what activities can subsequently open it. >> >> Lots of examples of this out there. >> >> -walter >> >> >>> Regards >>> >>> >>> 2011/5/27 Bert Freudenberg <b...@freudenbergs.de> >>> >>>> Step 1: search wiki for ObjectChooser. >>>> Step 2: find http://wiki.sugarlabs.org/go/Activity_Team/Object_Chooser >>>> Step 3: there is no step 3 >>>> >>>> - Bert - >>>> >>>> On 27.05.2011, at 17:49, laurent bernabe wrote: >>>> >>>> > Thank you. >>>> > >>>> > I've been on Sugar Almanach page in order to find ObjectChooser class, >>>> but i did not manage. >>>> > (i've been here : >>>> http://wiki.sugarlabs.org/go/Development_Team/Almanac ) >>>> > Where should i look ? >>>> > >>>> > Regards >>>> > >>>> > 2011/5/27 Gonzalo Odiard <gonz...@laptop.org> >>>> > If you use a FileChooserDialog, you don't have integration with the >>>> Journal. >>>> > You must use ObjectChooser. >>>> > >>>> > Gonzalo >>>> > >>>> > On Fri, May 27, 2011 at 11:56 AM, laurent bernabe < >>>> laurent.bern...@gmail.com> wrote: >>>> > Hello, >>>> > >>>> > i would like to use the FileChooserDialog in my application, which the >>>> PyGTK reference says it can be used with PyGTK >= 2.4. >>>> > Therefore, i wonder whereas oldest OLPC has already a PyGTK >= 2.4 >>>> version. >>>> > So, is it all right ? >>>> > >>>> > Regards >>>> >>> >>> >>> _______________________________________________ >>> Sugar-devel mailing list >>> Sugar-devel@lists.sugarlabs.org >>> http://lists.sugarlabs.org/listinfo/sugar-devel >>> >>> >> >> >> -- >> Walter Bender >> Sugar Labs >> http://www.sugarlabs.org >> >> >
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel