1. Marco Pensallorto
  2. django-storages

Commits

Marco Pensallorto  committed 45eeab9

Reimplemented seek with full file-like interface (now includes optional whence param).
Implementede tell, which was missing.

  • Participants
  • Parent commits 13b3d90
  • Branches default

Comments (0)

Files changed (1)

File storages/backends/mosso.py

View file
  • Ignore whitespace
     def closed(self):
         return not hasattr(self, '_file')
 
-    def seek(self, pos):
-        self._pos = pos
+
+    def seek(self, pos, whence=0):
+        if whence == 0:
+            self._pos = pos
+
+        elif whence == 1:
+            self._pos += pos
+
+        elif whence == 2:
+            self._pos = self._get_size() - self._pos
+
+        else: assert False
+
+    def tell(self):
+        return self._pos
 
 
 class ThreadSafeCloudFilesStorage(CloudFilesStorage):