1. Erik Wickstrom
  2. django-storages S3 Encryption

Commits

Erik Wickstrom  committed 07ac327

Added import error handling for ezPyCrypto

  • Participants
  • Parent commits 6144c5d
  • Branches default

Comments (0)

Files changed (1)

File s3.py

View file
 diff -r 86b22a931417 storages/backends/s3.py
 --- a/storages/backends/s3.py	Thu Jan 21 22:04:37 2010 +0000
-+++ b/storages/backends/s3.py	Thu Jan 21 22:06:17 2010 +0000
-@@ -72,7 +72,7 @@ class S3Storage(Storage):
++++ b/storages/backends/s3.py	Thu Jan 21 22:12:03 2010 +0000
+@@ -11,7 +11,10 @@ from django.core.files.base import File
+ from django.core.files.base import File
+ from django.core.files.storage import Storage
+ from django.utils.functional import curry
+-import ezPyCrypto
++try:
++    import ezPyCrypto
++except ImportError:
++    print "ImportError: Please download ezPyCrypto from http://www.freenet.org.nz/ezPyCrypto/"
+ 
+ try:
+     from S3 import AWSAuthConnection, QueryStringAuthGenerator
+@@ -72,7 +75,7 @@ class S3Storage(Storage):
          return os.path.normpath(name).replace('\\', '/')
  
      def _put_file(self, name, content):
  
              # Create a key object
              k = ezPyCrypto.key()
-@@ -114,7 +114,7 @@ class S3Storage(Storage):
+@@ -114,7 +117,7 @@ class S3Storage(Storage):
              raise IOError("S3StorageError: %s" % response.message)
          headers = response.http_response.msg