2868 Commits

Author SHA1 Message Date
Jef van Schendel
867f9acdc3 Add translation tags; remove unnecessary title attribute from link 2013-02-08 23:30:32 +01:00
Jef van Schendel
b78843a840 Remove unused translation variable 2013-02-08 23:28:13 +01:00
Jef van Schendel
44004c17e3 Fix "Add to collection" button: remove icon, add text, add to collections.html 2013-02-08 22:54:16 +01:00
Jef van Schendel
252de2b857 Remove the collection counter because it's not needed 2013-02-08 22:08:17 +01:00
Elrond
fb46fa663d Kill monkeypatching of ProcessingState.
And change the process_foo() API to accept a
processingstate now.

image and video are tested, the others are UNTESTED.
2013-02-08 10:09:37 +01:00
Elrond
715ea49546 Also refactor "copy original into public storage".
This makes the processing code easier to read/write and
alos will help the reprocessing once we get to it.

Thanks to Joar Wandborg for testing!
2013-02-08 10:09:37 +01:00
Elrond
bfd68cce85 Use ProcessingState for video.
Rewrite video to use the new ProcessingState.

Thanks to Joar Wandborg for testing!
2013-02-08 10:09:37 +01:00
Elrond
e382792637 ProcessingState: Document monkey patching. 2013-02-08 10:09:37 +01:00
Elrond
93b14fc300 Implement ProcessingState class and use for images
The idea is to have a class that has the knowledge of the
currently being processed media and also has tools for
that.

The long term idea is to make reprocessing easier by for
example hiding the way the original comes into the
processing code.
2013-02-08 10:05:42 +01:00
Joar Wandborg
9d7c69fb74 Use logging.config.fileConfig()
Instead of the monster I had built before.
2013-02-07 22:35:42 +01:00
Elrond
657a463799 Use system wide EXIF package, if available.
Created and tested by Simon Fondrie-Teitler.

Thanks!
2013-02-07 00:31:37 +01:00
Christopher Allan Webber
d9b59fc6e1 Committing extracted and compiled translations 2013-02-05 15:13:44 -06:00
Christopher Allan Webber
cd2def45fa Committing present MediaGoblin translations before pushing extracted messages 2013-02-05 15:12:27 -06:00
Elrond
8c659fd95c Rename {{title}} to {{media_title}}.
Rename a variable in a translated string to make it easier
for translators to know what they're dealing with.

And add a <title/> block.
2013-02-05 16:52:13 +01:00
Elrond
accb073e8c Mark "Collection" for translation in media_collect. 2013-02-05 16:25:19 +01:00
Aleksej
b79a1fa925 Small changes to "Add <media> to collection" string
Add quotation marks and "a" ("a" was proposed by Elrond).
2013-02-05 00:07:47 +04:00
Elrond
c9abf931cb issue 615: config geolocation_map_visible gone.
The template in the geolocation plugin still used the old
config option. Just remove that. To enable it, you enable
the plugin. No need for extra config.

Tested by manwesulimo2004 (via IRC).
2013-02-02 20:40:19 +01:00
Elrond
485404a9c4 Drop backward compatibility for media_data backref.
Now we only support media_type backrefs with uselist=False.
2013-02-01 22:02:35 +01:00
Elrond
139c6c099f Drop media_data_table property.
Only when creating a new media_data row, we need the table.
So load that locally in media_data_init().
2013-02-01 22:02:35 +01:00
Elrond
1f268deda4 Turn media.{backref_nam} from a list to a scalar.
For all our media_types, let the backref on the media_entry
be a scalar (there is only one media_data per media_entry)
instead of a list with zero or one entry.

The media_data toolchain on MediaEntry currently handles
both transparently.
2013-02-01 22:02:35 +01:00
Elrond
57f8d263e1 Rewrite media_data handling to use relationships
Instead of doing query by hand, use the relationships on
the models to find the media_data. Is is made possible by
the BACKREF_NAME in each models.py, which lets us know the
local attr to ask for.

Also initialize the relationship attribute on new
media_data instead of the media_id. Also do not add it to
the session. This gives us:
- This automatically initializes the other side of the
  relationship, which will allow later acces via that way.
- If the media_data is too early in the session, when the
  (new) media_entry is not yet in there, this could get
  conflicts. Avoid those by not adding to session.
- Uses cascading to commit media_data together with the
  media_entry.
2013-02-01 22:02:35 +01:00
Elrond
d728c636b9 Some tests for media_data, yeah!
One in the submissions, that posts a jpg with gps data.
One in the modelmethods to test some behaviours.

The later test fails.
Fixes coming up.
2013-02-01 22:02:29 +01:00
Elrond
cf41e7d744 Improve formatting for hook template docs. 2013-01-31 20:58:19 +01:00
Christopher Allan Webber
8a4d0dbc07 Switching set syntax to python2.6 compatible 2013-01-31 12:33:50 -06:00
Christopher Allan Webber
ec553298ff Even better documentation for get_hook_templates!
Tells how you *can* use it in templates if you really like.
2013-01-30 13:27:05 -06:00
Christopher Allan Webber
f097cf648c Improved documentation for get_hook_templates, noting the template tag 2013-01-30 13:25:20 -06:00
Christopher Allan Webber
08f3966d54 Moved the docstring for the plugin template stuff from the class to module method 2013-01-30 13:22:19 -06:00
Christopher Allan Webber
46da25827f No need for an __init__ at all in the TemplateHookExtension, really. 2013-01-30 13:22:19 -06:00
Christopher Allan Webber
927be5e8ca Move template hook over to a template_hook tag. Seems to work! :) 2013-01-30 13:22:19 -06:00
Christopher Allan Webber
e9c3384b84 Removing unused geolocation_map_visible variable and turning geolocation on in default config 2013-01-30 13:22:18 -06:00
Christopher Allan Webber
a3f811a6e8 Geolocation stuff, including including templates seems to be working-ish
- I'm having trouble seeing if the geolocation stuff actually works,
   but plugins are included
 - including a list of template hooks works, however the macro to
   include them does not, so it's kinda verbose
2013-01-30 13:22:18 -06:00
Christopher Allan Webber
1c2d01ae3b Very start of plugin hooks and openstreetmap pluginification
- Added start of template hook code to pluginapi.py
 - Started to break openstreetmap into plugin; moved templates
 - Added plugin hooks in media and image media templates

... almost certainly, none of this works yet. :)
2013-01-30 13:22:18 -06:00
Elrond
04453ccf42 Better Py3 compat: d.has_key(k) -> k in d
py3 does not have dict.has_key any more. You have to use
"key in dict" instead. As that works in python2 as well,
let's use that.

Also some small bits of pep8.
2013-01-30 15:03:04 +01:00
Elrond
3f931680e3 Improve runtime of one test.
Do not commit so often. flushing is enough.
2013-01-29 21:45:16 +01:00
Elrond
ff68ca9fc2 Fix issue 611: Proper (back)relationship on MediaComment.
well, fix the relationship on the comments.
2013-01-29 21:23:21 +01:00
Elrond
e9b4e50007 Failing testcase for issue 611.
This currently fails (with foreign key constrain error):
1. Have user A and B.
2. User B creates media M.
3. User A post a comment on M.
4. User A deletes his own account.

The test is a little bit wider.
2013-01-29 21:13:49 +01:00
Christopher Allan Webber
d5600aa75c Fix reference of get_test_app->get_app in test_modelmethods
(This changed in master while this test was being written; correcting
post-merge.)
2013-01-25 12:10:27 -06:00
Christopher Allan Webber
c7d135b6ea Merge branch '216_cwebber_style_unique_slugs' 2013-01-25 12:03:40 -06:00
Christopher Allan Webber
a81082fcaf New mediaentry slug tests now pass!
- fixed some issues with "whacking uuid junk on the slug"
 - uuid4() -> uuid.uuid4() so that mock will work right
 - added all the tests!
2013-01-23 16:49:54 -06:00
Christopher Allan Webber
b0118957ff We don't want any empty string slugs, so make "" -> None 2013-01-23 16:40:39 -06:00
Christopher Allan Webber
266b42b3dc Switching uuid4()[1:4] -> uuid4().hex[:4]
.hex is what we need to access to get at the ascii (hex) version
anyway.  Also, not sure why the previous version grabbed starting at
the index of 1... just grab the first characters instead.
2013-01-23 15:15:22 -06:00
Elrond
6194344bf9 Use better relationships to delete collections.
When deleting a User, his/her collections can be deleted by
sqlalchemy: Collections do not need any special code to be
executed on deletion.
2013-01-23 17:36:03 +01:00
Joar Wandborg
d63cc34e71 Made pil_filters a PIL_FILTERS (global) 2013-01-22 23:28:17 +01:00
Joar Wandborg
124081040b Changed sampling filter default to AA 2013-01-22 23:28:17 +01:00
Joar Wandborg
7cd7db5af4 Made the image sampling filter configurable
- Changed the default to BICUBIC instead of previous ANTIALIAS
2013-01-22 23:28:17 +01:00
Elrond
0c871f8122 Use inspect_table; default user license==None.
Use inspect_table in the new migration. Makes code more
readable, really.

And make the default for the preferred license be None.
This is a userspace thing, so we can even change the
migration here. Changing the migration means, that people
running the migration before this commit get a "" in
User.license_preference, while people running the migration
now get a None. Both values are okay.

None has been designated as "Use the site's default". We're
not actually having a site default right now. Which means
no license is selected in the dropdown.

While "" means "All rights reserved" being chosen by the
user.

Side note: Having no license being selected in the submit
dropdown is as "worse" as before and does not really hurt
much. MediaEntry.license==None means "All rights reserved"
as does "" also do.
2013-01-22 23:10:30 +01:00
Joar Wandborg
5c754fdaee Added option to skip transcoding
- If the video input matches the configurable rules, just copy it to the
  output without transcoding it.
2013-01-22 23:03:14 +01:00
Sebastian Spaeth
066d49b2c1 user.get('moo') -> user.moo
User fields are always existent, so there is no need to .get() them,
just use them directly.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2013-01-22 22:18:08 +01:00
Christopher Allan Webber
0ac8317ddc Removing docstring bit about delete_file possibly deleting directories in the future
I agree that delete_dir as a separate operation is a better way to do
things, especially since there is a non-recursive deletion option that
will politely fail if the directory is not empty.
2013-01-22 14:32:00 -06:00
Sebastian Spaeth
36ae6bcbbb Convert media processing backends to delete the queue directory (#254)
We never deleted our queue directory which were created per submission.
With the FileStorage backend being able to delete directories now, we can
request the deletion of the task directory too. It will only be deleted if
it is completely empty.
2013-01-22 14:05:54 -06:00