summaryrefslogtreecommitdiff
path: root/django/core/files/uploadhandler.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-02 13:12:09 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-02 13:12:09 -0700
commit7548aa8ffd46eb6e0f73730d1b2eb515ba581f95 (patch)
tree963393779f4c8c33351ea605f708f8da7d9f70bf /django/core/files/uploadhandler.py
parent65c4ac3b2434d1828cb76c9f4454fe64e81354ee (diff)
downloaddjango-7548aa8ffd46eb6e0f73730d1b2eb515ba581f95.tar.gz
More attacking E302 violators
Diffstat (limited to 'django/core/files/uploadhandler.py')
-rw-r--r--django/core/files/uploadhandler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/core/files/uploadhandler.py b/django/core/files/uploadhandler.py
index d267871bbd..3bd6993771 100644
--- a/django/core/files/uploadhandler.py
+++ b/django/core/files/uploadhandler.py
@@ -17,12 +17,14 @@ __all__ = [
'StopFutureHandlers'
]
+
class UploadFileException(Exception):
"""
Any error having to do with uploading files.
"""
pass
+
@python_2_unicode_compatible
class StopUpload(UploadFileException):
"""
@@ -42,12 +44,14 @@ class StopUpload(UploadFileException):
else:
return 'StopUpload: Consume request data, then halt.'
+
class SkipFile(UploadFileException):
"""
This exception is raised by an upload handler that wants to skip a given file.
"""
pass
+
class StopFutureHandlers(UploadFileException):
"""
Upload handers that have handled a file and do not want future handlers to
@@ -55,6 +59,7 @@ class StopFutureHandlers(UploadFileException):
"""
pass
+
class FileUploadHandler(object):
"""
Base class for streaming upload handlers.
@@ -124,6 +129,7 @@ class FileUploadHandler(object):
"""
pass
+
class TemporaryFileUploadHandler(FileUploadHandler):
"""
Upload handler that streams data into a temporary file.
@@ -146,6 +152,7 @@ class TemporaryFileUploadHandler(FileUploadHandler):
self.file.size = file_size
return self.file
+
class MemoryFileUploadHandler(FileUploadHandler):
"""
File upload handler to stream uploads into memory (used for small files).