Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-11 Thread Erik Blankinship
On Thu, Feb 10, 2011 at 1:20 PM, Samuel Greenfeld wrote: > As far as I know there really is no need; when your activity saves state > (when exiting, etc.), it should save the copied file as part of the > activity's journal entry. > > At least this is how it has always worked with Jukebox & Read.

Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Erik Blankinship
My suggestion appears to work. What would the community suggest as a better solution using the existing object chooser? On Feb 10, 2011, at 1:07 PM, Gonzalo Odiard wrote: > Please, don't do it. :( > > Gonzalo > > How does this idea look to the community? Seems hackish to me, but might >

Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Samuel Greenfeld
As far as I know there really is no need; when your activity saves state (when exiting, etc.), it should save the copied file as part of the activity's journal entry. At least this is how it has always worked with Jukebox & Read. (As a side note, the Journal description for a copied item often st

Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Gonzalo Odiard
Please, don't do it. :( Gonzalo How does this idea look to the community? Seems hackish to me, but might work? > > errything = datastore.find( {} )[0] > > ... > > dsobject = chooser.get_selected_object( ) > > from_journal = False > for errything_ds in errything: > if errything_ds.object_id

Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Erik Blankinship
On Thu, Feb 10, 2011 at 11:30 AM, Erik Blankinship wrote: > >> > How can I determine if a file loaded with a sugar object chooser was >> > selected from the datastore or from an external storage device? >> >> On Sugar 0.84+, there is no difference. Objects on external storage get >> copied to the

Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Erik Blankinship
> > > > How can I determine if a file loaded with a sugar object chooser was > > selected from the datastore or from an external storage device? > > On Sugar 0.84+, there is no difference. Objects on external storage get > copied to the data store first. > > But the objects don't get copied to the

Re: [Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Sascha Silbe
Excerpts from Erik Blankinship's message of Thu Feb 10 17:11:40 +0100 2011: > How can I determine if a file loaded with a sugar object chooser was > selected from the datastore or from an external storage device? On Sugar 0.84+, there is no difference. Objects on external storage get copied to th

[Sugar-devel] determine origin of file selected from an object chooser?

2011-02-10 Thread Erik Blankinship
How can I determine if a file loaded with a sugar object chooser was selected from the datastore or from an external storage device? dsobject = chooser.get_selected_object( ) logger.debug( "opening %s" % dsobject.file_path ) On an xo, opening a file from the usb results in something like: openin