Commit graph

12 commits

Author SHA1 Message Date
Matthew Tretter
c1b4c9bf71 Use cStringIO if available 2012-05-12 15:45:08 -04:00
Matthew Tretter
89eb05668e IKContentFile accepts format hint 2012-04-20 23:30:30 -04:00
Matthew Tretter
7b34716d9e Don't get extension of empty filename 2012-04-20 23:26:58 -04:00
Matthew Tretter
e0c9708e63 Extract reusable save_image function 2012-04-20 00:46:08 -04:00
Matthew Tretter
7d5937ebe6 Rename SpecFile and move it to utils 2012-04-19 21:33:56 -04:00
Matthew Tretter
8044b97a33 Extract suggest_extension util from generator 2012-04-19 21:33:52 -04:00
Matthew Tretter
6e4a8d1b58 Woah, globals 2012-04-09 21:27:09 -04:00
Clay McClure
db4df4f82c Add SpecFile.__unicode__
SpecFile is based after django.core.files.base.ContentFile, which lacks a __unicode__
method. This leads to an AttributeError when SpecFile.__repr__ is called. This is
easily resolved by giving SpecFile a proper __unicode__ method.
2012-03-27 17:17:54 -04:00
Clay McClure
2cf425d8a3 Wrap ContentFile in a file-like object with a filename and content_type.
This extra layer of indirection allows us to tack some attributes
(name and content_type) onto the underlying file, which we cannot
do with a StringIO since it's a native ctype.

These attributes are used by various third-party software that expects
to work with django.core.files.File instances, and not directly with
StringIO instances. By way of example, the django-storages mosso
backend (CloudFilesStorage) looks for a content_type attribute, and
the cloudfiles Object backend looks for a name attribute.
2012-02-29 05:01:31 -05:00
Matthew Tretter
b71102e7e8 Correct indentation error 2012-02-13 21:16:45 -05:00
Matthew Tretter
e71432d8ed Undo "return content" removal
I changed my mind. For now, at least.
2012-02-12 17:23:55 -05:00
Matthew Tretter
e31080ff4a Moved SpecFileGenerator to new module 2012-02-12 17:23:53 -05:00