From 286387b22e70ffe15f51e782ebf48a68ac3646f1 Mon Sep 17 00:00:00 2001 From: James Cameron Date: Thu, 1 Jun 2017 12:57:34 +1000 Subject: [PATCH] Save As - return copied datastore object When a datastore object is copied, return the new object to the caller. --- src/sugar3/datastore/datastore.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sugar3/datastore/datastore.py b/src/sugar3/datastore/datastore.py index 52744065..f68b20ec 100644 --- a/src/sugar3/datastore/datastore.py +++ b/src/sugar3/datastore/datastore.py @@ -470,6 +470,9 @@ def copy(ds_object, mount_point): ds_object -- DSObject to copy mount_point -- mount point of the new datastore entry + Returns: + new_ds_object -- DSObject copied + """ new_ds_object = ds_object.copy() new_ds_object.metadata['mountpoint'] = mount_point @@ -490,6 +493,8 @@ def copy(ds_object, mount_point): write(new_ds_object) + return new_ds_object + def get_unique_values(key): """Retrieve an array of unique values for a field.