aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/mg_globals.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove remaining imports/calls to six not automatically removed by pyupgrade.Ben Sturmfels2021-03-051-2/+0
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-051-1/+1
|
* Use six.iteritems() instead of dict.iteritems().Berker Peksag2014-05-261-1/+2
|
* Remove beaker stuff from the code.Brett Smith2013-03-241-3/+0
| | | | This is all obsoleted by It's Dangerous.
* Fixing translations stuff for command line tools and such.Christopher Allan Webber2013-02-271-2/+7
| | | | | | | | | | | We had switched mg_globals to have the default translations set to None so that it would be set up by the mediagoblin app later. However, this would mean that things like scripts would try to call gettext and error out. Thanks to Tumulte for catching this. This commit sponsored by Aurimas FiĊĦeras. Thank you!
* RIP out mongoSebastian Spaeth2012-12-251-4/+1
| | | | | | | | | Since sqlalchemy is providing our database abstraction and we have moved away from Mongo as the underlying database, it is now time to simplify things and rip out mongo. This provides the bulk of the changes, and can stand on its own. There are some followup tasks that can be done, such as removing now unneeded abstraction layers, e.g. db.sql.fake.py
* en_US is always availableSebastian Spaeth2012-12-021-2/+0
| | | | | | | | | | | We were using "en" as fallback only when no preferred language matched. This is obviously bad. Always insert en_US as available locale, so we can match it with the accept_languages. Don't set available_locales as mg_global, per discussion with paroneaya, make it a global var in translate.py Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Honor user's browser language (#558)Sebastian Spaeth2012-12-021-0/+2
| | | | | | | | | | | | | 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>
* Fix i18n in our browserSebastian Spaeth2012-12-011-5/+2
| | | | | | | | | | | | | | | | | | 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>
* make mg_globals.translations thread-safeJakob Kramer2012-07-181-1/+5
| | | | | I added mg_globals.thread_scope (an instance of threading.local) and made `translations' an attribute of it.
* It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
|
* Merge branch 'i507_beaker_cache'Christopher Allan Webber2011-09-051-0/+3
|\
| * Basic beaker caching functionality added to the application.Christopher Allan Webber2011-08-231-0/+3
| |
* | 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|/
* Adds license headerWill Kahn-Greene2011-07-301-0/+15
|
* removed email variables from globals moduleDeb2011-07-121-6/+0
|
* Documenting the setup_globals function.Christopher Allan Webber2011-06-191-0/+6
|
* Document our new global objects added during the configobj branchChristopher Allan Webber2011-06-191-0/+8
|
* Merge remote branch 'remotes/elrond/idea/globals_check'Christopher Allan Webber2011-06-191-0/+11
| | | | | Conflicts: mediagoblin/tests/test_globals.py
* mediagoblin.globals->mediagoblin.mg_globalsChristopher Allan Webber2011-06-121-0/+33