2147 Commits

Author SHA1 Message Date
Joar Wandborg
c56d4b55a1 Media type refractors, pep8, lint
- Removed THUMB_SIZE, MEDIUM_SIZE constants, depend on
  configuration values instead.
- pep8 refractoring
2012-03-26 17:44:08 +02:00
Derek Moore
fa72e51689 Updates to send email comments, included translation, better validation. 2012-03-25 22:25:54 -07:00
Jef van Schendel
7ccf418185 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-25 21:34:00 +02:00
Elrond
0608d57f5d Merge remote-tracking branch 'gandaro/forgot-password-autofillin'
* gandaro/forgot-password-autofillin:
  set username default server-side
  Fill username automatically in (Forget Password)
2012-03-25 21:34:05 +02:00
Jakob Kramer
952b97d5a0 set username default server-side 2012-03-25 21:51:09 +02:00
Jef van Schendel
afcb08553e Header style change 2012-03-25 21:33:52 +02:00
Brett Smith
84725abd64 Refactor video processing to use FilenameMunger. 2012-03-25 13:32:25 -04:00
Brett Smith
ab35ad4605 Use FilenameMunger. 2012-03-25 13:26:57 -04:00
Brett Smith
4774cfa3c0 Add documentation to the FilenameMunger class. 2012-03-25 12:16:19 -04:00
Brett Smith
095fbdaf8d Add FilenameMunger class to processing, with tests.
Munging filenames is something all media type processors want to be able to
do, so I'm refactoring it out into a nice bite-sized class.
2012-03-25 12:11:13 -04:00
Elrond
5101f84404 Drop debug from migration. 2012-03-25 15:01:24 +02:00
Elrond
e63656fcf7 Cleanup mongo->sql converter.
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).
2012-03-25 14:42:03 +02:00
Elrond
f7ab2f42ea Do not fill media_data['exif'] any more. 2012-03-25 14:42:03 +02:00
Elrond
11d36843b0 Migration fixup: Drop empty exif_all.
If the exif info is totally empty, do not add it at all to
the media_data dict in mongo.
2012-03-25 14:42:03 +02:00
Elrond
c8c75ad044 Create migration to move exif data around in media_data.
Move media_data['exif']['clean'] to media_data['exif_all']
drop media_data['exif']['useful']
drop media_data['exif']
2012-03-25 14:42:03 +02:00
Elrond
f116a1243f Use exif_display_iter in the template.
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.
2012-03-25 14:42:03 +02:00
Elrond
763ef5b77e Start to fill media_data.exif_all in addition.
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.
2012-03-25 14:12:53 +02:00
Jakob Kramer
6c49799deb Fill username automatically in (Forget Password)
Fill the username automatically in the "Forget Password" form
if the user already entered his username on the login page
2012-03-24 17:39:52 +01:00
Christopher Allan Webber
db4039165f Merge remote-tracking branch 'remotes/gandaro/wipealldata-from-db_name' 2012-03-24 09:58:26 -05:00
Jakob Kramer
9edd71ebf7 Wipe the configured database, not the default one 2012-03-24 15:33:36 +01:00
Jakob Kramer
e8be1d7af5 Allow arrow keys in input fields and textareas
If you pressed an arrow key in a textarea before, the next/previous media
was opened.
2012-03-24 14:49:43 +01:00
Jakob Kramer
32d8cf4511 remove unused `mg.submit.security' module 2012-03-23 22:13:48 +01:00
Elrond
7b82f56bae Fix cyclic import issue.
Oh well:

tools.exif -> processing -> db.util -> db.models -> db.mixin -> tools.exif

So import tools.exif locally in exif_display_iter()
2012-03-23 20:28:11 +01:00
Elrond
5bad26bc47 Create MediaEntry.exif_display_iter()
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.
2012-03-23 20:20:54 +01:00
Elrond
e0b0588fb1 image_mediadata: Add exif_all column 2012-03-23 19:22:28 +01:00
Elrond
e0e7232af9 Add copyright header to image/models.py 2012-03-23 19:22:28 +01:00
Jakob Kramer
fbf56c1a5d correct wrong version number
(`-dev' instead of `.dev')
2012-03-23 18:15:46 +01:00
Elrond
99c2f9f0c4 New media_data row needs to know its MediaEntry's id.
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?
2012-03-22 21:21:38 +01:00
Joar Wandborg
a9d84d4cb7 Faster sniffing
- 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.
2012-03-22 01:27:19 +01:00
Elrond
ecd538bb65 Add index=True for some columns.
These are the columns that seem to make the most sense to
have an index on them.
2012-03-21 22:46:38 +01:00
Elrond
e136ad3ed6 Finally load all models.
Load all models for the media_types. This was stopped by a
celery problem. But that is now fixed.
2012-03-21 21:48:09 +01:00
Elrond
32adc9b2a7 Panel: Find "unprocessed" not "processing" entries.
Our entries in the queue are marked as "unprocessed" and
not as "processing" as the panel code wanted it to be. So
search for the correct string.
2012-03-21 12:17:57 +01:00
Elrond
4114e54df5 And fix the in-celeryd import.
So that celeryd also loads the task.
2012-03-21 12:17:52 +01:00
Elrond
eace050a7d Move celery task into own task.py
Move the actual celery task from processing/__init__.py
into its own .../task.py. That way it can be imported as
needed.
2012-03-21 12:12:07 +01:00
Elrond
4bdee988b6 Turn processing.py into a submodule.
processing.py -> processing/__init__.py

This is in preparation for splitting processing a bit.
The main reason for the split is celery setup: celery needs
to be setup before even importing and importing and
subclassing some of its parts. So it's better to move the
critical parts into their own submodule and import it as
late as needed.
2012-03-21 12:11:58 +01:00
Christopher Allan Webber
8839540656 Merge remote-tracking branch 'refs/remotes/brett/bug270-lazycelery-script' 2012-03-20 23:24:43 -05:00
Brett Smith
6573573dd1 Add tests for image processing. Check filenames and image sizes.
This test helps verify that bug #261 is actually fixed.

In order to test that all the processed images are smaller, I needed to add
an image that's bigger than processing.MEDIUM_SIZE, hence bigblue.png.
2012-03-20 23:59:28 -04:00
Brett Smith
e75d4a0dd5 Make a function to generate test image filenames. 2012-03-20 23:03:11 -04:00
Brett Smith
d1f52dc776 Prefer nose assert_* methods to the assert built-in. 2012-03-20 22:40:32 -04:00
Brett Smith
c373903494 Refactor false image tests. 2012-03-20 22:36:56 -04:00
Brett Smith
c0e87ec9d2 Refactor normal upload tests.
This is nice because it means we do *all* the normal sanity tests for *all*
the normal uploads.  check_url() can be used in other tests too.
2012-03-20 22:30:57 -04:00
Brett Smith
77445d13ad Refactor MediaEntry fetches/checks into check_media(). 2012-03-20 22:16:28 -04:00
Brett Smith
31dd6013b8 Refactor data posts into one do_post function.
All the data posts in these tests had a lot of common code.  Putting all
that into a function makes it easier to write more tests (which I'll be
doing in a bit) and see what's really being tested.
2012-03-20 22:07:32 -04:00
Elrond
8fd81053b4 More standard media_data model for ascii.
ascii doesn't use media_data at all. So it needs the most
basic media_data model. Fix it to take the current form.
2012-03-20 23:55:28 +01:00
Elrond
b829595334 Create load_models().
So all models are ready when connecting to the db and so
our "db" object has all models listed on it, create a
function to load all models from the media_types, etc. Call
it in setup_database()

Problem: This gives celery warnings, because celery is
imported before being setup properly. No idea how to fix
this now. So media-type loading is excluded from
load_models for now.
2012-03-20 12:45:40 +01:00
Elrond
39fd817ab8 Import "Base" from base instead of models.
Import the "Base" class for models from db.sql.base instead
of db.sql.models.
2012-03-20 12:45:40 +01:00
Elrond
df7c405845 Disable query logging for now, so we get nicer logs
As the queries are quite verbose, disable them for now.
Reenabling them should be done in the central logging
config, which is another story for celery and bin/gmg.
2012-03-20 12:45:40 +01:00
Jakob Kramer
6b45ec1b0c 500 error because of subscripting instead of using attributes 2012-03-18 22:28:22 +01:00
Christopher Allan Webber
5f08116352 Committing extracted and compiled translations 2012-03-18 15:16:37 -05:00
Christopher Allan Webber
50fd85967f Committing present MediaGoblin translations before pushing extracted messages 2012-03-18 15:16:03 -05:00