mediagoblin.git
11 years agoConvert return HttpException to raise HttpException
Sebastian Spaeth [Sun, 23 Dec 2012 10:58:51 +0000 (11:58 +0100)]
Convert return HttpException to raise HttpException

controllers (view function) raise HttpException's and do not return them.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoProvide tools.response.render_http_exception and use that
Sebastian Spaeth [Sun, 23 Dec 2012 10:57:45 +0000 (11:57 +0100)]
Provide tools.response.render_http_exception and use that

After the webob->werkzeug transition, controller functions can raise
werkzeug.HttpExceptions. We need to catch these in app.py when calling
the controller and handle them, rendering the corresponding error Response()
object. For consistency, we also want to allow meddleware functions to
raise HttpExceptions (e.g. the csrf meddleware needs to complain about lack
of cookies), so wrap the request and response parts of the meddleware too.

Finally, the urlmap.match() can also raise HttpExceptions, so we give it the
same treatment (render_http_exception). I am not sure, if we do not need to
handle the Redirect exception there in any different way though...

The new function render_http_exception makes use of the render_error infrastructure
to return a nicely templated error page. It also checks if the stock error
messages was used in cases where we have localizations (403, 404) and use those.

It is now possible to do things like "raise Forbidden(_('You suckr'))" or
raise NotFound(_('where is my left show again')) if you want to return
customized error messages to the user.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoRevert accidental checkin
Sebastian Spaeth [Sat, 22 Dec 2012 11:05:03 +0000 (12:05 +0100)]
Revert accidental checkin

Commit 8d19cb2445e2aa1f53431da26d866bf9b5e25872 accidentally included
my docs/source/build directory. Removing it again. Thanks to Elrond for
noticing.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoWe're in 0.3.3.dev territory now.
Christopher Allan Webber [Fri, 21 Dec 2012 15:08:52 +0000 (09:08 -0600)]
We're in 0.3.3.dev territory now.

11 years agoRemove mongolisms from auth.views
Sebastian Spaeth [Fri, 21 Dec 2012 09:35:05 +0000 (10:35 +0100)]
Remove mongolisms from auth.views

Remove find find_one etc and use sqlalchemy syntax

11 years agoRemove Mongoism query.skip()
Sebastian Spaeth [Mon, 17 Dec 2012 11:56:29 +0000 (12:56 +0100)]
Remove Mongoism query.skip()

sqlalchemy supports slice() or [n:m] just fine.

Right now, it seems we cannot distinguish beween "empty" results
and out-of bound slices. It would be nice if we could distinguish
these somehow.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoRemove mongolisms from user_pages.view #451
Sebastian Spaeth [Fri, 21 Dec 2012 10:25:38 +0000 (11:25 +0100)]
Remove mongolisms from user_pages.view #451

11 years agoRefactor media_collect
Sebastian Spaeth [Fri, 21 Dec 2012 10:25:13 +0000 (11:25 +0100)]
Refactor media_collect

Remove lots of MOngolisms. Refactor this to remove some indentation
levels. Don't do:
 if success:
   ...
   if success:
     ....
     if success:
     ...

11 years agoMerge branch '577_denoise_video_transcoding'
Sebastian Spaeth [Fri, 21 Dec 2012 08:11:21 +0000 (09:11 +0100)]
Merge branch '577_denoise_video_transcoding'

11 years agoDon't dbug log every added plugin route
Sebastian Spaeth [Fri, 21 Dec 2012 07:20:54 +0000 (08:20 +0100)]
Don't dbug log every added plugin route

It is killing testsuite output by drowning out all signals. It should
be sufficient to state in the pluginmanager that routes have been added,
if we need that kind of output.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoDon't require webob as dependency
Sebastian Spaeth [Fri, 16 Nov 2012 10:32:35 +0000 (11:32 +0100)]
Don't require webob as dependency

It is pushing up the daisies. Also relnote the change.

11 years agoRemove webob compatability
Sebastian Spaeth [Fri, 16 Nov 2012 10:36:04 +0000 (11:36 +0100)]
Remove webob compatability

Remove the aliases we provided for webob compatability as webob is
now gone. Grepped the code base to check for occurences of the old
parameters to be safe. Keep request.GET attribute as alias for
request.args as it is often used and django is also using that
attribute.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoplugins/api: webob.Response -> werkzeug.Response
Sebastian Spaeth [Fri, 16 Nov 2012 10:31:16 +0000 (11:31 +0100)]
plugins/api: webob.Response -> werkzeug.Response

11 years agoplugins/api: use headers.set(), not headers.update()
Sebastian Spaeth [Wed, 12 Dec 2012 10:38:51 +0000 (11:38 +0100)]
plugins/api: use headers.set(), not headers.update()

The werkzeug.Response().headers do not offer an update() method as
the same key can be twice in the header 'dict'. Thus, iterate over
the header keys and use header.set(key, value) which replaces an
existing header key.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoreplace webob.Response with werkzeug Response
Sebastian Spaeth [Fri, 16 Nov 2012 10:21:15 +0000 (11:21 +0100)]
replace webob.Response with werkzeug Response

Replace webob usage in one more file. Document a TODO that should
be clarified, we should probably be using json_response rather than
Response() here.

Modify the TestMeddleware to not rely on the content_type attribute
being present, while werkzeug.wrappers Response() has it the BaseResponse()
object which is often returned in tests does not have it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoTransition webob BadRequest|HTTPFound to webob/redirect
Sebastian Spaeth [Fri, 16 Nov 2012 10:13:01 +0000 (11:13 +0100)]
Transition webob BadRequest|HTTPFound to webob/redirect

More transitioning away from webob
Response import from webob was unused

11 years agotests/auth: Don't rely on case sensitive error strings
Sebastian Spaeth [Wed, 12 Dec 2012 10:54:43 +0000 (11:54 +0100)]
tests/auth: Don't rely on case sensitive error strings

webob's 404 status is "404 NOT FOUND" while werkzeug's is
"404 Not Found". Our test suite was checking the upper case string
for equality. Just test the status error code "404" rather than the
full string which might change at some points/versions and should
not need to be tested.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agowebob.HTTPFound --> MG.tools.redirect
Sebastian Spaeth [Fri, 16 Nov 2012 10:05:08 +0000 (11:05 +0100)]
webob.HTTPFound --> MG.tools.redirect

Transition away from webob.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoTransition webob.HttpForbidden to webob's exceptions Forbidden
Sebastian Spaeth [Thu, 15 Nov 2012 15:55:15 +0000 (16:55 +0100)]
Transition webob.HttpForbidden to webob's exceptions Forbidden

Also the BadRequest exception.

11 years agoRemove webobisms from decorators.py
Sebastian Spaeth [Thu, 15 Nov 2012 15:49:51 +0000 (16:49 +0100)]
Remove webobisms from decorators.py

Use our own redirect function rather than webobs HttpFound
Also replace HttpForbidden() with webob's Forbidden()

11 years agopurge webob from docs and replace with werkzeug
Sebastian Spaeth [Thu, 15 Nov 2012 15:57:33 +0000 (16:57 +0100)]
purge webob from docs and replace with werkzeug

11 years agoRemove webob from render_to_response
Sebastian Spaeth [Fri, 16 Nov 2012 09:25:50 +0000 (10:25 +0100)]
Remove webob from render_to_response

We were still using webob's Response objects for template rendering.
Transition to werkzeug's Response object. One caveat was that it
seemed to have used the default mimetype "text/plain" for all pages,
so we override the default Response class, setting the default mime
type to "text/html".

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoExtend redirect helper to take optional location keyword
Sebastian Spaeth [Fri, 16 Nov 2012 08:12:34 +0000 (09:12 +0100)]
Extend redirect helper to take optional location keyword

In order to move away from webob with its redirect(location=...) we
need to provide a redirect function that allows to directly specify
the URL rather than the urlgen parameters that we now use.

Extend our MG.tools:redirect helper so we can pass in the direct URL
via the optional "location" keyword.

This commit does not switch over any redirect consumers yet.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoRemove SimpleFieldAlias
Sebastian Spaeth [Thu, 20 Dec 2012 22:10:07 +0000 (23:10 +0100)]
Remove SimpleFieldAlias

It was only used for the model._id -> model.id conversion and is not
needed anymore.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoMove DBModel._id -> DBModel.id
Sebastian Spaeth [Fri, 30 Nov 2012 09:49:06 +0000 (10:49 +0100)]
Move DBModel._id -> DBModel.id

We were refering to model._id in most of the code base as this is
what Mongo uses. However, each use of _id required a) fixup of queries:
e.g. what we did in our find() and find_one() functions moving all
'_id' to 'id'. It also required using AliasFields to make the ._id
attribute available. This all means lots of superfluous fixing and
transitioning in a SQL world.

It will also not work in the long run. Much newer code already refers
to the objects by model.id (e.g. in the oauth plugin), which will break
with Mongo. So let's be honest, rip out the _id mongoism and live with
.id as the one canonical way to address objects.

This commit modifies all users and providers of model._id to use
model.id instead. This patch works with or without Mongo removed first,
but will break Mongo usage (even more than before)

I have not bothered to fixup db.mongo.* and db.sql.convert
(which converts from Mongo to SQL)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoFix up tests
Sebastian Spaeth [Thu, 20 Dec 2012 23:27:59 +0000 (00:27 +0100)]
Fix up tests

empty find() queries would not work anymore with the simplified .find
compatability code, so remove these and use proper sqlalchemy in the
tests.

The storage test failed because my virtualenv environment ran
mediagoblin/local/mediagoblin/tests/test_storage.py and somehow decided
the 2 classes are different objects. Just test against the full class name.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoFixing tyop'ed "dbupdate"
Christopher Allan Webber [Thu, 20 Dec 2012 19:54:03 +0000 (13:54 -0600)]
Fixing tyop'ed "dbupdate"

11 years agoNOW RELEASING: MediaGoblin 0.3.2! :D
Christopher Allan Webber [Thu, 20 Dec 2012 17:16:29 +0000 (11:16 -0600)]
NOW RELEASING: MediaGoblin 0.3.2! :D

11 years agoCommitting extracted and compiled translations
Christopher Allan Webber [Thu, 20 Dec 2012 16:11:54 +0000 (10:11 -0600)]
Committing extracted and compiled translations

11 years agoCommitting present MediaGoblin translations before pushing extracted messages
Christopher Allan Webber [Thu, 20 Dec 2012 16:11:34 +0000 (10:11 -0600)]
Committing present MediaGoblin translations before pushing extracted messages

11 years ago0.3.2 release notes
Christopher Allan Webber [Thu, 20 Dec 2012 15:48:47 +0000 (09:48 -0600)]
0.3.2 release notes

11 years agoUpdating AUTHORS with new contributors. Nice job new contributors! :)
Christopher Allan Webber [Thu, 20 Dec 2012 15:27:56 +0000 (09:27 -0600)]
Updating AUTHORS with new contributors.  Nice job new contributors! :)

11 years agoCommitting extracted and compiled translations
Christopher Allan Webber [Thu, 20 Dec 2012 15:19:50 +0000 (09:19 -0600)]
Committing extracted and compiled translations

11 years agoDocs fix: Adding proper blank line after the "Run::"
Christopher Allan Webber [Thu, 20 Dec 2012 14:22:49 +0000 (08:22 -0600)]
Docs fix: Adding proper blank line after the "Run::"

11 years agoAdded documentation on how to add STL support, and notes on running ./bin/gmg dbupdate
Christopher Allan Webber [Thu, 20 Dec 2012 14:18:19 +0000 (08:18 -0600)]
Added documentation on how to add STL support, and notes on running ./bin/gmg dbupdate

11 years agoOnly log output and write progress to db if it has changed
Sebastian Spaeth [Wed, 19 Dec 2012 14:43:38 +0000 (15:43 +0100)]
Only log output and write progress to db if it has changed

De-noisify the transcoding log and db updates. Previously we would log
and save the progress percentage every second, even if it had not changed
at all. Save progress:oercentage in the Transcoder and only log/update
when the percentage has actually changed.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoTry ipython-based shell first, falling back to plain shell
Sebastian Spaeth [Tue, 18 Dec 2012 15:54:07 +0000 (16:54 +0100)]
Try ipython-based shell first, falling back to plain shell

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agomakeadmin and changepasswd had swapped help text
Christopher Allan Webber [Tue, 18 Dec 2012 22:46:20 +0000 (16:46 -0600)]
makeadmin and changepasswd had swapped help text

11 years agoRemove collection_thumbnail styling, so collection thumbnails are styled the same...
Jef van Schendel [Sun, 16 Dec 2012 20:57:19 +0000 (21:57 +0100)]
Remove collection_thumbnail styling, so collection thumbnails are styled the same as other thumbnails

11 years agoRelease note 0.3.2 blurb
Sebastian Spaeth [Sat, 15 Dec 2012 20:00:41 +0000 (21:00 +0100)]
Release note 0.3.2 blurb

On MongoDB...

11 years agoAdding info to the docs about running dbupdate
Christopher Allan Webber [Sat, 15 Dec 2012 00:29:00 +0000 (18:29 -0600)]
Adding info to the docs about running dbupdate

Both adding info to run it when adding new media types, and adding
info that you might need to stop mediagoblin before you run these
commands.

11 years agoSwitching both gettext calls to _() so babel can find/extract them.
Christopher Allan Webber [Fri, 14 Dec 2012 16:49:05 +0000 (10:49 -0600)]
Switching both gettext calls to _() so babel can find/extract them.

Babel looks for _() and gettext() so this is necessary.

11 years agoAdd comments explaining how translitcodec *is* used
Christopher Allan Webber [Fri, 14 Dec 2012 15:28:44 +0000 (09:28 -0600)]
Add comments explaining how translitcodec *is* used

11 years agoAdd example to the lazy gettext version to make clear when it's appropriate
Sebastian Spaeth [Fri, 14 Dec 2012 14:16:49 +0000 (15:16 +0100)]
Add example to the lazy gettext version to make clear when it's appropriate

I needed an example to really get when lazy_gettext would be good...

11 years agoUse the correct translation mechanism
Sebastian Spaeth [Fri, 14 Dec 2012 11:55:21 +0000 (12:55 +0100)]
Use the correct translation mechanism

We accidentally used the fake translation mechanism here which will not
actually translate anything.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoFiy python2.7'ism (#566)
Sebastian Spaeth [Fri, 14 Dec 2012 09:54:53 +0000 (10:54 +0100)]
Fiy python2.7'ism (#566)

The oauth plugin used timedelta.total_seconds which was introduced
in python 2.7 only. To preserve backwards compatability, we simply
calculate the time difference in seconds manually.

I considered monkeypatching total_seconds to the timedelta object,
but it is a built-in type written in C (I believe) and modifying
attributes failed horribly. Switch this to use total_seconds once we
require python 2.7 as minimum version.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoSmall styling edits to thumbnails
Jef van Schendel [Thu, 13 Dec 2012 22:39:19 +0000 (23:39 +0100)]
Small styling edits to thumbnails

11 years agoMake "add media to collection" a normal <img/>
Elrond [Thu, 13 Dec 2012 20:07:16 +0000 (21:07 +0100)]
Make "add media to collection" a normal <img/>

This button used to be a css style <a href=...> </a> (note:
No contents for the <a>). Using this approach has various
drawbacks. Most notably:
- Not clickable in text mode browsers
- Possibly getting marked as a hidden (spam) link
- No alt attribute

So replaced with a real <img/>.

I have no idea what to put in the alt attribute.

11 years agoMigrate some fixes from base.html to airy/base.html.
Elrond [Thu, 13 Dec 2012 14:29:36 +0000 (15:29 +0100)]
Migrate some fixes from base.html to airy/base.html.

When fixing our templates, we should always take a look at
the other themes and fix those too.

11 years agoDo not translate just a variable expansion.
Elrond [Wed, 12 Dec 2012 20:25:17 +0000 (21:25 +0100)]
Do not translate just a variable expansion.

No point in translating <p>{{ var }}</p>. Really.

This does not hurt the string freeze, as it removes a
translateable string.  So any translations of this string
are just well ...  usefuless afterwards.

11 years agoFix spacing in links to attachment files.
Elrond [Mon, 3 Dec 2012 15:36:34 +0000 (16:36 +0100)]
Fix spacing in links to attachment files.

We had """<a href="abc.dat"> abc.dat</a>""" (note the
apace).  And this space is being rendered as a link by
browsers.  This looks strange, really.

So fix the spacing.

11 years agoWe don't need to save entries during processing... also adding comments explaining...
Christopher Allan Webber [Wed, 12 Dec 2012 16:13:56 +0000 (10:13 -0600)]
We don't need to save entries during processing... also adding comments explaining such

11 years agoMore unicode fixes in the test suite
Sebastian Spaeth [Wed, 12 Dec 2012 11:29:22 +0000 (12:29 +0100)]
More unicode fixes in the test suite

Pass in unicode not (binary) strings where sqlite expects unicode
values to prevent the test suite from (correctly) complaining about
errors.

I now pass the full suite without any complaints.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoSetting the user profile back to 3 columns wide!
Christopher Allan Webber [Wed, 12 Dec 2012 01:58:25 +0000 (19:58 -0600)]
Setting the user profile back to 3 columns wide!

Previously this was set to two when the spacing between thumbs got borkified.

11 years agoMake sqlalchemy stop complaining about non-unicode input
Sebastian Spaeth [Tue, 11 Dec 2012 15:55:11 +0000 (16:55 +0100)]
Make sqlalchemy stop complaining about non-unicode input

These tests output noisy sql complaints about receiving non-unicode
for an unicode field. This was ... well ... because we were handing
in non-unicode usernames and passwords.

Prefixing usernames/passwords with u'' makes the testsuite less noisy
and verbose.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoFix CSRF tests with webtest 1.4.0
Sebastian Spaeth [Tue, 11 Dec 2012 14:38:28 +0000 (15:38 +0100)]
Fix CSRF tests with webtest 1.4.0

CSRF tests apparently passed with earlier versions of webtest, but
failed with the latest webtest (1.4.0) package. It choked on passing
a "key=value; " cookie as it split at the semicolon and failed to
find additional values or something like that. Removing the semicolon
makes this test pass.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoRemove print statments from this migration.
Christopher Allan Webber [Mon, 10 Dec 2012 22:14:28 +0000 (16:14 -0600)]
Remove print statments from this migration.

The reason for wanting to give extra information to the user (this is
a very special case migration) is good, but we don't have a nice
"official" way to capture and present that information during tests,
so removing this.

11 years agoFix typo, disable debugging.
Elrond [Sun, 9 Dec 2012 19:14:15 +0000 (20:14 +0100)]
Fix typo, disable debugging.

11 years agoUniqueConstraing migration: Adding the explaining comments.
Elrond [Sun, 9 Dec 2012 18:50:33 +0000 (19:50 +0100)]
UniqueConstraing migration: Adding the explaining comments.

Add a lengthy comment explaining all the variants.

11 years agoFixing our broken CollectionItem unique constraint.
Elrond [Wed, 28 Nov 2012 15:44:43 +0000 (16:44 +0100)]
Fixing our broken CollectionItem unique constraint.

This one seems to work nicely in all relevant situations.
See comments inside the source.

11 years agoEnsure query_dict is a dict after the contents have been modified.
Nathan Yergler [Tue, 27 Nov 2012 04:24:30 +0000 (20:24 -0800)]
Ensure query_dict is a dict after the contents have been modified.

_fix_query_dict modifies its argument in place. Ensure that the
argument passed in has a local name and will be passed into the
subsequent filter_by call.

11 years agoEeek! Set the migration number to the current migration number being run!
Christopher Allan Webber [Sun, 9 Dec 2012 18:20:06 +0000 (12:20 -0600)]
Eeek!  Set the migration number to the current migration number being run!

11 years agoElrond's suggestion: have set_current_migration execute after each migration run.
Christopher Allan Webber [Sun, 9 Dec 2012 18:12:07 +0000 (12:12 -0600)]
Elrond's suggestion: have set_current_migration execute after each migration run.

11 years agoCommitting extracted and compiled translations
Christopher Allan Webber [Fri, 7 Dec 2012 18:46:37 +0000 (12:46 -0600)]
Committing extracted and compiled translations

11 years agoCommitting present MediaGoblin translations before pushing extracted messages
Christopher Allan Webber [Fri, 7 Dec 2012 18:45:47 +0000 (12:45 -0600)]
Committing present MediaGoblin translations before pushing extracted messages

11 years agoAdd a UniqueConstraint add test in test_sql_migrations
Christopher Allan Webber [Wed, 5 Dec 2012 22:13:22 +0000 (16:13 -0600)]
Add a UniqueConstraint add test in test_sql_migrations

We should have this anyway, and Elrond needs it to help fix current
broken migration thingies.

11 years agoFix user collection gallery
Sebastian Spaeth [Wed, 5 Dec 2012 12:42:00 +0000 (13:42 +0100)]
Fix user collection gallery

We were fetching the user collection gallery by slug only, so if two users
had the same collection slug, we would not have been sure which one we'd get.

Fix this by explicitly only fetching the specific user's collections. Also
switch over the view function to make use of the new active_user_from_url
decorator that fetches the User() object for us.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoSwitch over the user gallery to the active_user_from_url decorator
Sebastian Spaeth [Wed, 5 Dec 2012 12:38:50 +0000 (13:38 +0100)]
Switch over the user gallery to the active_user_from_url decorator

This switches the user gallery page over to use the new decorator, and
cleans up the queries to be in proper sqlalchemy format rather than the
old mongo format.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoCreate a active_user_from_url decorator
Sebastian Spaeth [Wed, 5 Dec 2012 12:37:19 +0000 (13:37 +0100)]
Create a active_user_from_url decorator

This can be used for URL patterns containing a <user> element. It will look
up the corresponding user among all active users and return a 404 NOT FOUND
page if there is no such active user. It then passes the User() instance as
url_user keyword argument to the decorated view function.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoRemove gridify_*
Sebastian Spaeth [Tue, 4 Dec 2012 16:28:53 +0000 (17:28 +0100)]
Remove gridify_*

We injected a gridify_list and gridify_cursor function into each jinja2
template that we render. This was used to split the list of media_entries
into batches of 5 for nicer table columns. However, jinja2 has a nice |batch
filter built in that does the job for us just as well with less code (on our side)

Less code=good

so let's merge this one.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoWe arean't using header_dropdown.js anymore because the dropdown is gone!
Christopher Allan Webber [Tue, 4 Dec 2012 15:34:41 +0000 (09:34 -0600)]
We arean't using header_dropdown.js anymore because the dropdown is gone!

11 years agomake media_manager a property of MediaEntry in mixin.py
Sebastian Spaeth [Tue, 4 Dec 2012 08:57:56 +0000 (09:57 +0100)]
make media_manager a property of MediaEntry in mixin.py

In all cases where get_media_manager(_media_type_as_string) was called in
our code base we ultimately passed in a "MediaEntry().media_type" to get
the matching MEDIA_MANAGER. It so makes sense to make this a function of
the MediaEntry rather than a global function in mediagoblin.media_types and
passing around media_entry.media_type as arguments all the time.

It saves a few import statements and arguments. I also made it so the
Media_manager property is cached for subsequent calls, although I am not too
sure that this is needed (there are other cases for which this would make
more sense)

Also add a get_media_manager test to the media submission tests. It submits
an image and checks that both media.media_type and media.media_manager
return the right thing. Not sure if these tests could not be merged with an
existing submission test, but it can't hurt to have things explicit.

TODO: Right now we iterate through all existing media_managers to find the
right one based on the string of its module name. This should be made a simple
dict lookup to avoid all the extra work.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoFallback to "en_US" if browser does not send preferred languages
Sebastian Spaeth [Tue, 4 Dec 2012 08:44:07 +0000 (09:44 +0100)]
Fallback to "en_US" if browser does not send preferred languages

E.g. in our test suite we don't send an "accepted languages" header, which
caused the language matching to fail. So we need to explicitely fallback to
en_US, in case request.accepted_languages is None. This fixes the tests and
all cases where user browsers don't send preferred languages.

This also fixes issue #562, the AVAILABLE_LOCALES are already case-normalized
and we don't need to fudge the preferred language through the lower_upper_locale
thing for each and every request.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoMoving thingiview.js into extlib/
Christopher Allan Webber [Mon, 3 Dec 2012 20:57:52 +0000 (14:57 -0600)]
Moving thingiview.js into extlib/

11 years agoSwitch stl processing over to using the workbench
Christopher Allan Webber [Sun, 2 Dec 2012 20:14:15 +0000 (14:14 -0600)]
Switch stl processing over to using the workbench

Previously this was writing directly to the public store... that won't
work with cloudfiles backend, for example :)

11 years agoCorrecting minor typo in exception string: Empyt->Empty
Christopher Allan Webber [Sun, 2 Dec 2012 17:33:32 +0000 (11:33 -0600)]
Correcting minor typo in exception string: Empyt->Empty

11 years agoRemoving unused conversions subdir
Christopher Allan Webber [Sun, 2 Dec 2012 17:28:54 +0000 (11:28 -0600)]
Removing unused conversions subdir

11 years agoMoving blender render files to be accessed via pkg_resources
Christopher Allan Webber [Sun, 2 Dec 2012 02:16:15 +0000 (20:16 -0600)]
Moving blender render files to be accessed via pkg_resources

Previously the .blend and .py files had to be in the same directory
mediagoblin/celery launched from.  This is now fixed so it pulls them
out of the package proper.

11 years agoRemoving render_test.py, which isn't used
Christopher Allan Webber [Sun, 2 Dec 2012 01:46:49 +0000 (19:46 -0600)]
Removing render_test.py, which isn't used

11 years agoRemoved debug info from the sidebar.
Aeva Ntsc [Tue, 16 Oct 2012 07:11:34 +0000 (02:11 -0500)]
Removed debug info from the sidebar.

11 years agotweaking the template
Aeva Ntsc [Tue, 16 Oct 2012 06:55:04 +0000 (01:55 -0500)]
tweaking the template

11 years agoFixed the binary stl loader.
Aeva Ntsc [Tue, 16 Oct 2012 06:54:27 +0000 (01:54 -0500)]
Fixed the binary stl loader.

11 years agoDisabled thingiview for obj models, since thingiview's support for them seems to...
Aeva Ntsc [Tue, 16 Oct 2012 06:02:05 +0000 (01:02 -0500)]
Disabled thingiview for obj models, since thingiview's support for them seems to be broken.

11 years agoAdded a table to store the file extension of a model.
Aeva Ntsc [Tue, 16 Oct 2012 06:01:34 +0000 (01:01 -0500)]
Added a table to store the file extension of a model.

11 years agoUpdated the template for viewing stl models.
Aeva Ntsc [Tue, 16 Oct 2012 05:38:39 +0000 (00:38 -0500)]
Updated the template for viewing stl models.

11 years agoAdded preview rendering for a bunch of different shots.
Aeva Ntsc [Tue, 16 Oct 2012 05:38:08 +0000 (00:38 -0500)]
Added preview rendering for a bunch of different shots.

11 years agoCatching ValueError when trying to use ObjModel on binary stl files.
Aeva Ntsc [Tue, 16 Oct 2012 05:37:44 +0000 (00:37 -0500)]
Catching ValueError when trying to use ObjModel on binary stl files.

11 years agoAdded script for manually testing the blender renderer.
Aeva Ntsc [Tue, 16 Oct 2012 05:35:37 +0000 (00:35 -0500)]
Added script for manually testing the blender renderer.

11 years agoAdded blender renderer
Aeva Ntsc [Tue, 16 Oct 2012 05:35:09 +0000 (00:35 -0500)]
Added blender renderer

11 years agomade 3d viewer a little cleaner
Aeva Ntsc [Mon, 15 Oct 2012 15:10:32 +0000 (10:10 -0500)]
made 3d viewer a little cleaner

11 years agodisabled auto rotate
Aeva Ntsc [Mon, 15 Oct 2012 15:10:04 +0000 (10:10 -0500)]
disabled auto rotate

11 years agoAdded the stl/obj mediatype.
Aeva Ntsc [Mon, 15 Oct 2012 06:36:26 +0000 (01:36 -0500)]
Added the stl/obj mediatype.

11 years agoAdded a rudimentary template for the stl/obj viewer.
Aeva Ntsc [Mon, 15 Oct 2012 06:35:59 +0000 (01:35 -0500)]
Added a rudimentary template for the stl/obj viewer.

11 years agoAdded the thingiview.js library.
Aeva Ntsc [Mon, 15 Oct 2012 06:34:11 +0000 (01:34 -0500)]
Added the thingiview.js library.

11 years agoAdded the thingiview.js library.
Aeva Ntsc [Mon, 15 Oct 2012 06:33:38 +0000 (01:33 -0500)]
Added the thingiview.js library.

11 years agoCommitting extracted and compiled translations
Christopher Allan Webber [Mon, 3 Dec 2012 19:23:55 +0000 (13:23 -0600)]
Committing extracted and compiled translations

11 years agoCommitting present MediaGoblin translations before pushing extracted messages
Christopher Allan Webber [Mon, 3 Dec 2012 19:23:02 +0000 (13:23 -0600)]
Committing present MediaGoblin translations before pushing extracted messages

11 years agoFix translations around.
Elrond [Mon, 3 Dec 2012 13:19:28 +0000 (14:19 +0100)]
Fix translations around.

This includes:
- Mark more strings for translation
- Don't mark html-only nonsense for translation
- Mark a better part for translation.

11 years agoGo back to pre-login URL after loging in
Sebastian Spaeth [Mon, 26 Nov 2012 16:03:24 +0000 (17:03 +0100)]
Go back to pre-login URL after loging in

Simply append the current URL (sans querystring) as a ?next= parameter
to the login URL. This will always take us back to the original page
where we were pre-login.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
11 years agoProvide jinja2 urlencode filter
Sebastian Spaeth [Mon, 26 Nov 2012 20:24:35 +0000 (21:24 +0100)]
Provide jinja2 urlencode filter

Astonishingly, the great jinja2 does not provide a builtin urlquote filter,
although it is obviously needed. (jina1 had one) This is:
https://github.com/mitsuhiko/jinja2/issues/17

Provide an urlencode filter, based on werkzeug's url_quote_plus function.
This is dead easy to implement and gives us all the freedom we want.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>