Changes

Line 146: Line 146:  
         print my_dsobject.metadata['description']
 
         print my_dsobject.metadata['description']
    +
</pre>
 +
This code snippet shows how to create a pixbuf from the preview entry in the datastore:
 +
<pre>
 +
from sugar.datastore import datastore
 +
...
 +
        #my_dsobject is of type datastore.DSObject
 +
        #object_id is a datastore object (returned from the datastore Chooser
 +
        my_dsobject = datastore.get(object_id)
 +
 +
        pixbufloader = gtk.gdk.pixbuf_loader_new_with_mime_type('image/png')
 +
        #Access the 'preview' property
 +
        #Note that the preview image is 300x225
 +
        pixbufloader.write(dsobject.metadata['preview'])
 +
        pixbufloader.close()
 +
        pixbuf = pixbufloader.get_pixbuf()
 
</pre>
 
</pre>