Matthew Tretter
9dd7bef709
Simplify import
2013-01-23 22:07:31 -05:00
Matthew Tretter
d52b9c8100
Add utility for extracting field info
2013-01-23 21:47:54 -05:00
Matthew Tretter
4737ac64c4
Specs no longer accept arbitrary kwargs
...
Only the source.
2013-01-23 21:35:38 -05:00
Matthew Tretter
6ff1d35fbe
Remove unused import
2013-01-23 21:31:53 -05:00
Matthew Tretter
eef1e41448
Remove code that used old filename kwarg
2013-01-23 21:28:23 -05:00
Matthew Tretter
d632fc70fa
Copy contents to NamedTemporaryFile if generated file has no name
2013-01-23 21:27:21 -05:00
Matthew Tretter
4ecfa5d35e
Don't rely on source filename being relative path
...
Closes #180
2013-01-13 23:40:26 -05:00
Matthew Tretter
8c5a571293
Remove unused import
...
Fixes flake8 error
2013-01-13 23:35:19 -05:00
Matthew Tretter
e5b15d09bd
Remove _generateimage utility.
2013-01-09 00:28:29 -05:00
Matthew Tretter
5acce98223
Remove extra space
2013-01-09 00:26:47 -05:00
Matthew Tretter
219b8507ad
Add thumbnail tag tests
2013-01-09 00:25:28 -05:00
Matthew Tretter
43a1f49498
New thumbnail tag syntax! Closes #177
2013-01-09 00:25:08 -05:00
Matthew Tretter
3177eb8e19
Extract utils for use in other modules
2013-01-08 23:36:22 -05:00
Matthew Tretter
11d511f9cc
Extract util for parsing common bits.
...
In preparation for new thumbnail and placeholder tag syntaxes (#177 and
#176 ) which share some (but not all) syntax with the generateimage tag.
2013-01-08 22:42:42 -05:00
Matthew Tretter
658bb22c78
Special case serialization of ImageFieldFiles
...
Closes #168
2013-01-08 21:52:56 -05:00
Matthew Tretter
c2dedaa2b8
Use file name; not file, which can't be pickled
2013-01-08 20:57:19 -05:00
Matthew Tretter
faee0fa537
Correct typo
2013-01-08 20:36:17 -05:00
Matthew Tretter
d80f2f26a9
"source" now refers to the file itself
2012-12-11 22:53:13 -05:00
Matthew Tretter
184c13dd4e
More source_group renaming
2012-12-11 22:41:10 -05:00
Matthew Tretter
52fb4e24be
Add thumbnail templatetag
...
Finally!
2012-12-07 00:42:11 -05:00
Matthew Tretter
30e40b4916
Add TODO for unregistration
2012-12-07 00:17:35 -05:00
Matthew Tretter
c69c2d087e
Create Thumbnail spec; closes #175
2012-12-06 23:48:09 -05:00
Matthew Tretter
1fb1d83c56
Add Thumbnail processor
2012-12-06 23:22:02 -05:00
Matthew Tretter
8c80ba3b4f
GeneratedImageCacheFile stores file manipulation attributes
...
Everything for dealing with files should be part of
GeneratedImageCacheFile--not the generator. The fact that
GeneratedImageCacheFile can get this information (storage, filename,
etc.) is a convenience so that the user only has to define one class
(the generator) to fully specify their functionality, but handling the
cache file is not part of the core responsibility of the generator.
This is also the reason for the renaming of `get_filename` and `storage`
to `cache_file_name` and `cache_file_storage`: the generator is just as
useful for those who want to generate persistent files. But the original
attribute names didn't indicate that they were used only for cache
files. The new ones do, and don't preclude the addition of other
versions that would be used by another `File` subclass for specifying
file names or storage classes.
2012-12-06 19:54:26 -05:00
Matthew Tretter
12307c97aa
Use state--not constructor args--to recreate dynamic specs
...
Previously, we were relying on `__init__`'s arguments to recreate specs.
Now we do it the proper way, using the dict returned by `__getstate__`
(which may or may not include those arguments).
2012-12-05 23:51:30 -05:00
Matthew Tretter
042bdcefb6
Simplify dynamic spec definitions
...
Use a closure instead of an attribute to store the class attrs.
2012-12-05 23:38:10 -05:00
Matthew Tretter
c45876f95c
Ignore some style errors
2012-12-05 23:16:34 -05:00
Matthew Tretter
2a6199b804
Simplify get_hash implementation
2012-12-05 23:16:07 -05:00
Matthew Tretter
7578903307
Fix test
2012-12-05 21:10:36 -05:00
Matthew Tretter
0ec6067c8d
Correct pickling/unpickling of dynamic specs
...
Previously, __reduce__ was returning a reduction of the class, not the
instance.
2012-12-05 21:10:36 -05:00
Matthew Tretter
938e2e178b
Clean up test utils; write to media dir
2012-12-05 21:10:36 -05:00
Matthew Tretter
7f11f44c67
Special case source_file for specs
...
It was already special. Why hide it? Closes #173
2012-12-05 21:10:31 -05:00
Matthew Tretter
ea962b6259
Correct argument order
...
Related: 2cc72cd
2012-12-05 21:09:10 -05:00
Matthew Tretter
afc5900db6
Support decorator syntax for register.spec
2012-12-05 21:09:10 -05:00
Matthew Tretter
956601b5d0
Revert register.spec argument order
...
Since we got rid of inner Config classes, we can put the order back and
support decorators.
2012-12-05 21:09:10 -05:00
Matthew Tretter
a07bc49a25
Remove inner Config classes
2012-12-05 21:09:10 -05:00
Matthew Tretter
a5c33a4925
Add tests for generateimage template tag
...
Currently, these will fail because the temporary file cannot be pickled
in order to generate a hash.
2012-12-03 22:25:12 -05:00
Matthew Tretter
a499f5fbe6
Add util for generating named image file
2012-12-03 22:24:55 -05:00
Matthew Tretter
4f7ce68904
Add documentation for generateimage
2012-12-03 21:11:52 -05:00
Matthew Tretter
4f81e14f58
Re-add html attribute handling
2012-12-03 21:06:15 -05:00
Matthew Tretter
848d7d7fa3
Add TODOs
2012-12-01 23:19:45 -05:00
Matthew Tretter
14d2193f8d
Remove unused args
2012-12-01 22:23:25 -05:00
Matthew Tretter
db777594ce
Merge branch 'generator-supreme' into ik-next
2012-12-01 22:12:00 -05:00
Matthew Tretter
236eea8459
Move filename generation to generator
2012-12-01 22:09:34 -05:00
Matthew Tretter
20c900df4a
Remove unused imports
2012-12-01 21:52:23 -05:00
Matthew Tretter
7bc82d3624
Remove arguments from generate() method
...
Previously, we had two places where we were passing kwargs that affected
the image generation: the ImageSpec constructor and the generate method.
These were essentially partial applications. With this commit, there's
only one partial application (when the spec is instantiated), and the
generate method is called without arguments. Therefore, specs can now
be treated as generic generators whose constructors just happen to
accept a source_file.
2012-12-01 21:20:33 -05:00
Matthew Tretter
5ecb491e65
Remove unused import
2012-12-01 20:47:55 -05:00
Matthew Tretter
7ed404f096
Switch args back to old order
2012-12-01 20:45:34 -05:00
Matthew Tretter
1f06c9ac70
Remove ImageSpecCacheFile
2012-12-01 20:41:08 -05:00
Matthew Tretter
9188499965
Rework template tag for generators
2012-12-01 20:36:31 -05:00