Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2010-08-30 16:29:30 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-08-30 16:29:48 (GMT)
commit3935fc9de44493cd1e3921144faecffdd30f47ab (patch)
tree9a7fa14e144ce3455509037159661b04eceecf60
parentcd88faaf2cffdb0755d5d14e09834a08a82137ad (diff)
fix timestamp handling on non-version support data stores
-rw-r--r--restore.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/restore.py b/restore.py
index 2e4518a..af970f4 100644
--- a/restore.py
+++ b/restore.py
@@ -429,24 +429,24 @@ class AsyncRestore(gobject.GObject):
entry = self._find_entry_v1(uid)
if entry:
ds_timestamp = entry.get('timestamp') or \
- time.strftime(CTIME_FORMAT, entry[0]['ctime'])
+ time.strftime(CTIME_FORMAT, entry['ctime'])
if ds_timestamp >= timestamp:
logging.info('Skipping outdated entry for %r', uid)
return
-
- self._data_store.update(uid, metadata, data_path, True,
- timeout=DS_DBUS_SAVE_TIMEOUT)
-
+ else:
+ logging.info('Overwriting older entry for %r', uid)
else:
- self._data_store.create(metadata, data_path, True,
- timeout=DS_DBUS_SAVE_TIMEOUT)
+ logging.info('Restoring entry %r', uid)
+
+ self._data_store.update(uid, metadata, data_path, True,
+ timeout=DS_DBUS_SAVE_TIMEOUT)
def _find_entry_v1(self, uid):
"""Retrieve given entry from v1 data store if it exists.
"""
try:
- return self._data_store.get_properties(uid,
+ return self._data_store.get_properties(uid, byte_arrays=True,
timeout=DS_DBUS_SIMPLE_FIND_TIMEOUT)
except dbus.DBusException, exception: