Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <silbe@activitycentral.com>2011-02-11 12:17:20 (GMT)
committer Sascha Silbe <silbe@activitycentral.com>2011-02-15 20:24:16 (GMT)
commit665dbc43edd33010508a2d173150cba7b36d3ea2 (patch)
tree07b493cac361befa358fcd599b7e4d2dafd215ad
parenta4314e3f7c6fb046a267fd6c0ccee46b64a7480f (diff)
don't choke if timestamp property is missing
The timestamp property might be missing due to incomplete writes (out of power, system crash) or software bugs. Signed-off-by: Sascha Silbe <silbe@activitycentral.com> Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r--src/carquinyol/datastore.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/carquinyol/datastore.py b/src/carquinyol/datastore.py
index 837de35..41ec2c3 100644
--- a/src/carquinyol/datastore.py
+++ b/src/carquinyol/datastore.py
@@ -140,6 +140,9 @@ class DataStore(dbus.service.Object):
if os.path.exists(path):
props['filesize'] = os.stat(path).st_size
update_metadata = True
+ if 'timestamp' not in props:
+ props['timestamp'] = str(int(time.time()))
+ update_metadata = True
if 'creation_time' not in props:
if 'ctime' in props:
try: