[Dextrose] [PATCH] set ctime workaround

Martin Abente martin.abente.lahaye at gmail.com
Tue Jan 11 09:55:51 EST 2011


From: Esteban Bordon <ebordon at plan.ceibal.edu.uy>

This is a workaround to set te ctime in sugar-toolkit.

---
 src/sugar/datastore/datastore.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py
index 1618cef..db75665 100644
--- a/src/sugar/datastore/datastore.py
+++ b/src/sugar/datastore/datastore.py
@@ -305,6 +305,8 @@ def create():
     metadata = DSMetadata()
     metadata['mtime'] = datetime.now().isoformat()
     metadata['timestamp'] = int(time.time())
+    if not metadata.get('ctime'):
+        metadata['ctime'] = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime())
     return DSObject(object_id=None, metadata=metadata, file_path=None)
 
 
-- 
1.7.1



More information about the Dextrose mailing list