| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would attempt to satisfy the user's first language
preference, immediately falling back to english if that was not
possible. Now, we will get the best match of the user's preferred
languages.
This requires storing the available locales on app startup, so we
have mg_globals.available_locales ready to compare them against the
list of preferred user languages.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We only ever served english pages since the switch to werkzeug's requests.
Fix this by actually checking the accepted languages that our web browser
sends and using that or falling back to english.
This is not optimal, imaging our browser sends "klingon, de" as accepted
languages and we happen to not have a klingon translation ready (a deficiency
that should be corrected immediately anyway!!). We would then fall back
to english rather than sending the sensible and pleasant German language
which the user would understand. This will require more backend work though.
Removing the gettext.find() in mg_globals.py. It looked in the wrong directory
anyway (mediagoblin/translations) and as that does not exist, had always returned
None without anyone noticing.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
| |
Changed route name to "[...]list_connections"
|
|
|
|
|
| |
- Removed ?lang=<langcode> feature due to incompatibility with werkzeug
routes in the current state of the architecture.
|
|
|
|
|
|
|
|
|
|
| |
Removed the Routes routing functionality and replaced it with
werkzeug.routes. Most views are functional.
Known issues:
- Translation integration with the request object is not yet figured
out. This breaks 404 pages.
|
|
|
|
|
| |
- Fixed error handling in OAuth plugin
- Changed request.POST file fields to request.files
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reworks the plugin infrastructure so as to remove module-loading
side-effects which were making things a pain in the ass to test.
With the new system, there's no auto-registering meta class. Instead
plugins do whatever they want and then specify a hooks dict that maps
hook names to callables for the things they're tying into. The most
common one (and the only one we've implemented so far) is "setup".
This also simplifies the sampleplugin a little by moving the code
to __init__.py.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This fixes the template loader so that it can load plugin templates.
This adds code for registering template paths so that plugins can add
their own templates.
This adds the base code for the flatpagesfile plugin. It doesn't serve
pages, yet, but it's pretty close.
|
|
|
|
|
| |
This will reduce the amount of work reproducing this behavior when
pulling together the theme registry elsewhere.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* implements installing, loading and setup for plugins
* codifies configuration
* has a sample plugin
* docs
* tests
|
|
|
|
| |
Might be useful at some point.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The cleanup could be missed if the request handling code in
app.py:__call__ exits early (due to exception, or due to
one of those early "return"s).
So to make sure the sql session is cleaned up for real,
wrap the whole thing in a try: finally:.
Also wrote a short tool to test if the session is actually
empty. The tool is currently disabled, but ready to be
used.
|
|
|
|
|
|
|
|
|
|
|
| |
It's good practice to cleanup the SQL session after each
request so that the next request gets a fresh one.
It's an application decision whether one wants a
just-in-case ROLLBACK or COMMIT. There are two ideas behind
it, really. I have decided for ROLLBACK. The idea is "if
you forget to commit your changes yourself, there's
something broken. Maybe you got an exception?".
|
|
|
|
|
|
|
| |
There was no place in the software telling the user the
version in use. So start by having the main server emit a
startup notice including the version string. Uses python
logging, so should be easy to reconfigure, etc.
|
| |
|
|
|
|
|
| |
So that the workaround can eventually be removed, note the
URL for the relevant bug in a comment.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is relevant for fcgi:
Some servers (cherokee for example) put "HTTP":"off" in the
environ. And the following code in urlgen breaks on this:
if environ.get('HTTPS') or environ.get('wsgi.url_scheme') == 'https' \
or environ.get('HTTP_X_FORWARDED_PROTO') == 'https':
hostinfo['protocol'] = 'https'
workaround is to remove HTTPS:off from the environ.
|
| |
|
| |
|
|
|
|
|
|
| |
middleware
hehehehehe, "meddleware"
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
mediagoblin/db/migrations.py
mediagoblin/db/models.py
mediagoblin/user_pages/views.py
mediagoblin/util.py
|
| |
| |
| |
| |
| |
| |
| | |
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
|
| |
| |
| |
| |
| | |
This way we can copy paste.ini into paste_local.ini but not have to
update it to find mediagoblin_local.ini.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When running mediagoblin in a sub path on a web server,
most things inside mediagoblin need the "inside path", but
when generating URLs for the webbrowser, full paths are
needed.
urlgen and routes already do that.
Some (mostly pagination and login) need the URL of the
current page. They used request.path_info. But this is the
"inside" path, not the full.
So now there is request.full_path and its used in various
places.
|
|/ / |
|
| | |
|
|/
|
|
| |
tools/[file].py
|
|\ |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
| |
first)
This will make it easier for us to call something like a 404 page rendering method
before the matching check is done.
|
| |
|
|
|
|
|
|
|
| |
Factoring out this one should be the last one needed to
rewrite the celery setup. The idea is to not setup the
whole app, but just call a bunch of individual setup_*
functions and be done.
|
|
|
|
|
|
| |
Setting up the database now involves checking the
migrations status and setting up the globals.
Moved all of that into init/__init__.py:setup_database().
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
mediagoblin/db/open.py
|
| | |
|
| | |
|
| | |
|