[Sugar-devel] determine origin of file selected from an object chooser?
Erik Blankinship
erikb at mediamods.com
Thu Feb 10 12:57:30 EST 2011
On Thu, Feb 10, 2011 at 11:30 AM, Erik Blankinship <erikb at mediamods.com>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 data store first.
>>
>>
> But the objects don't get copied to the Journal (or at least I don't see
> them there).
>
> Maybe I should rephrase my question: how can I know if the selected object
> was loaded from the Journal?
>
> What I am trying to do:
> If an object is loaded from an external device, I want to add a copy of
> that object to the user's journal.
>
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 == dsobject.object_id:
from_journal = True
break
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110210/d308aab5/attachment.html>
More information about the Sugar-devel
mailing list