so that they no longer import from PIL explicitly.
This is due to explicit PIL.Image* imports failing
on a Ubuntu machine within virtualenv.
PIL is a mystery I have yet to find the energy to unravel.
The 'implicit' approach works both for the affected
machine and my local machine and I've seen it more often
out in the wild, so I'm assuming it is the right way.
The code often needs to know some fields of the test user
even after doing some sql and stuff. The solultion is to
reload it and properly detach it from its Session. That way
all its fields are available and the whole thing is not
connected to a session. It feels like a normal object.
This merge involved moving the new FilenameBuilder class to
processing/__init__.py, and putting the comment deletion tests back into
test_submission.py using the refactored functions.
- Changed config files of test configs to use SQL
- Updated celery initialization tools, factored them to be able to
use the "big instance" application stuff
1. No need to drop media_data['exif'], we only have and
want media_data['exif_all'].
2. Use media['_id'] instead of media._id (better not use
dot-notation on mongo objects in such a low level tool).
As the newly created entries have media_data.exif_all use
the exif_display_iter method to calculate the exif entries
for displaying on the fly.
After the mongo migration all the old entries will also
have exif_all and will work again.
In addition to filling the normal slot media_data['exif'],
now also fill media_data.exif_all. This is the new slot
used by SQL.
For a few moments this will create duplicated entries in
the mongo db. But this shouldn't hurt.
MediaEntry.media_data.exif_all will contain all the
"clean" EXIF data.
MediaEntry.exif_display_iter() is an iterator that fetches
the most interesting entries for display from that data.
When creating a new media_data row, the new row needs to
know the MediaEntry it is associated with. I have no idea,
why this worked before at all. Maybe some implicit tricks
by sqlalchemy?
- Sniffing now goes through the old extension-based filter before
doing it the bitsniffing way.
- Refractored get_media_type_and_manager(filename).
- Removed ogg extension from video accepted extensions, audio
will take care of that.
- Added custom audio player, still WIP,but working.
- Added test for sniffing. This only tests for the
mediagoblin.media_types.image type, as that is the only
one enabled from start.