Commits

Alan Justino  committed d0e420e Merge

Merge upstream repo

  • Participants
  • Parent commits 4524c96, 02afdf3
  • Branches filecache_storage_proposal

Comments (0)

Files changed (5)

 3e8e477cf67db87f3ac796e9743b81b71867fd0d 1.1.4
 ae4dad30b2f6b4edc328cc0f9cf25b888e090f7d 1.1.5
 082f958b38117b2f043a5e85aaaad97157480048 1.1.6
+c32a25c5ed5da39a9f6866336f6cccad0343b659 1.1.7

File CHANGELOG.rst

 django-storages change log
 ==========================
 
+1.1.7 (2013-03-20)
+******************
+
+* Listing of huge buckets on S3 is now prevented by using the prefix argument to boto's list() method
+* Initial support for Windows Azure Storage
+* Switched to useing boto's parse_ts date parser getting last modified info when using S3boto backend
+* Fixed key handling in S3boto and Google Storage backends
+* Account for lack of multipart upload in Google Storage backend
+* Fixed seek() issue when using AWS_IS_GZIPPED by darkness51 with pull-request `#50`_
+* Improvements to S3BotoStorage and GSBotoStorage
+
+.. _#50: https://bitbucket.org/david/django-storages/pull-request/50/
+
 1.1.6 (2013-01-06)
 ******************
 

File storages/__init__.py

-__version__ = '1.1.6'
+__version__ = '1.1.7'

File storages/backends/s3boto.py

 import os
 import mimetypes
 from gzip import GzipFile
+import datetime
 
 try:
     from cStringIO import StringIO
                                "higher.\nSee https://github.com/boto/boto")
 
 
+def parse_ts_extended(ts):
+    RFC1123 = '%a, %d %b %Y %H:%M:%S %Z'
+    rv = None
+    try:
+        rv = parse_ts(ts)
+    except ValueError:
+        rv = datetime.datetime.strptime(ts, RFC1123)
+    return rv
+
+
 def safe_join(base, *paths):
     """
     A version of django.utils._os.safe_join for S3 paths.
         # check if some of the settings we've provided as class attributes
         # need to be overwritten with values passed in here
         for name, value in settings.items():
-            if name in self.__dict__:
+            if hasattr(self, name):
                 setattr(self, name, value)
 
         # For backward-compatibility of old differing parameter names
         if entry is None:
             entry = self.bucket.get_key(self._encode_name(name))
         # Parse the last_modified string to a local datetime object.
-        return parse_ts(entry.last_modified)
+        return parse_ts_extended(entry.last_modified)
 
     def url(self, name):
         name = self._normalize_name(self._clean_name(name))

File storages/tests/s3boto.py

 import mock
 from uuid import uuid4
 from urllib2 import urlopen
+import datetime
 
 from django.test import TestCase
 from django.core.files.base import ContentFile
 from storages.backends import s3boto
 
 __all__ = (
+    'ParseTsExtendedCase',
     'SafeJoinTest',
     'S3BotoStorageTests',
     #'S3BotoStorageFileTests',
 )
 
+class ParseTsExtendedCase(TestCase):
+    def test_normal(self):
+        value = s3boto.parse_ts_extended("Wed, 13 Mar 2013 12:45:49 GMT")
+        self.assertEquals(value, datetime.datetime(2013, 3, 13, 12, 45, 49))
+
 class S3BotoTestCase(TestCase):
     @mock.patch('storages.backends.s3boto.S3Connection')
     def setUp(self, S3Connection):