Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2010-08-24 17:37:30 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2010-08-24 17:37:30 (GMT)
commit08bf8535f4121666de9ea7226cbc3b4e49b810a6 (patch)
tree84fb6cb1527261c33b66b3afc43a809880ec07ad
parentaa3abc1eca119fa8e2a92ceb001d73c826031c12 (diff)
Reviewer comments #1915v0.89.3
-rw-r--r--src/carquinyol/datastore.py14
-rw-r--r--src/carquinyol/migration.py1
2 files changed, 10 insertions, 5 deletions
diff --git a/src/carquinyol/datastore.py b/src/carquinyol/datastore.py
index ac3d42d..46cf5fd 100644
--- a/src/carquinyol/datastore.py
+++ b/src/carquinyol/datastore.py
@@ -130,9 +130,13 @@ class DataStore(dbus.service.Object):
update_metadata = True
if 'creation_time' not in props:
if 'ctime' in props:
- props['creation_time'] = time.mktime(time.strptime(
- props['ctime'], migration.DATE_FORMAT))
- else:
+ try:
+ props['creation_time'] = time.mktime(
+ time.strptime(props['ctime'],
+ migration.DATE_FORMAT))
+ except (TypeError, ValueError):
+ pass
+ if 'creation_time' not in props:
props['creation_time'] = props['timestamp']
update_metadata = True
if update_metadata:
@@ -183,7 +187,7 @@ class DataStore(dbus.service.Object):
pass
if 'creation_time' not in props:
- props['creation_time'] = time.time()
+ props['creation_time'] = props['timestamp']
if os.path.exists(file_path):
stat = os.stat(file_path)
@@ -236,7 +240,7 @@ class DataStore(dbus.service.Object):
pass
if 'creation_time' not in props:
- props['creation_time'] = time.time()
+ props['creation_time'] = props['timestamp']
if os.path.exists(file_path):
stat = os.stat(file_path)
diff --git a/src/carquinyol/migration.py b/src/carquinyol/migration.py
index 4d19af6..686902f 100644
--- a/src/carquinyol/migration.py
+++ b/src/carquinyol/migration.py
@@ -64,6 +64,7 @@ def migrate_from_0():
def _migrate_metadata(root_path, old_root_path, uid):
+ metadata_path = layoutmanager.get_instance().get_metadata_path(uid)
old_metadata_path = os.path.join(old_root_path, uid + '.metadata')
metadata = cjson.decode(open(old_metadata_path, 'r').read())