[Sugar-devel] [PATCH v1 5/5] Implement migration from DS v0 for ctime property.

Andrés Ambrois andresambrois at gmail.com
Sun May 23 08:04:11 EDT 2010


Signed-off-by: Andrés Ambrois <andresambrois at gmail.com>
---
 src/carquinyol/migration.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/carquinyol/migration.py b/src/carquinyol/migration.py
index 228467c..80adbae 100644
--- a/src/carquinyol/migration.py
+++ b/src/carquinyol/migration.py
@@ -73,6 +73,9 @@ def _migrate_metadata(root_path, old_root_path, uid):
         metadata['timestamp'] = \
                 time.mktime(time.strptime(metadata['mtime'], DATE_FORMAT))
 
+    if 'ctime' not in metadata:
+        metadata['ctime'] = int(os.stat(old_metadata_path).st_ctime)
+
     file_path = layoutmanager.get_instance().get_data_path(uid)
     if 'filesize' not in metadata:
         if os.path.exists(file_path):
-- 
1.6.3.3



More information about the Sugar-devel mailing list