Bug fixes. trash
authorAntony Chazapis <chazapis@gmail.com>
Sat, 16 Jul 2011 15:29:19 +0000 (18:29 +0300)
committerAntony Chazapis <chazapis@gmail.com>
Sat, 16 Jul 2011 15:29:19 +0000 (18:29 +0300)
pithos/backends/simple.py

index 0aecb68..cdc53a5 100644 (file)
@@ -211,7 +211,7 @@ class SimpleBackend(BaseBackend):
         if self._get_pathcount(account) > 0:
             raise IndexError('Account is not empty')
         sql = 'delete from versions where name = ?'
-        self.con.execute(sql, (path,))
+        self.con.execute(sql, (account,))
         sql = 'delete from groups where name = ?'
         self.con.execute(sql, (account,))
         self.con.commit()
@@ -643,7 +643,7 @@ class SimpleBackend(BaseBackend):
     
     def _get_version(self, path, version=None):
         if version is None:
-            sql = '''select version_id, user, strftime('%s', tstamp), size, hide from versions where name = ?
+            sql = '''select version_id, user, tstamp, size, hide from versions where name = ?
                         order by version_id desc limit 1'''
             c = self.con.execute(sql, (path,))
             row = c.fetchone()
@@ -651,7 +651,7 @@ class SimpleBackend(BaseBackend):
                 raise NameError('Object does not exist')
         else:
             # The database (sqlite) will not complain if the version is not an integer.
-            sql = '''select version_id, user, strftime('%s', tstamp), size from versions where name = ?
+            sql = '''select version_id, user, tstamp, size from versions where name = ?
                         and version_id = ?'''
             c = self.con.execute(sql, (path, version))
             row = c.fetchone()