Set up virtualenv to use py2
[mediagoblin.git] / mediagoblin / mg_globals.py
index 356a944d981cfa86efa941207ec528d2cb0b7d1c..26ed66fab87eedae3fcfb22210e9efb114457c65 100644 (file)
@@ -26,15 +26,9 @@ import threading
 # General mediagoblin globals
 #############################
 
-# mongokit.Connection
-db_connection = None
-
-# mongokit.Connection
+# SQL database engine
 database = None
 
-# beaker's cache manager
-cache = None
-
 # should be the same as the 
 public_store = None
 queue_store = None
@@ -45,8 +39,13 @@ workbench_manager = None
 # A thread-local scope
 thread_scope = threading.local()
 
-# gettext (this will be populated on demand with gettext.Translations)
-thread_scope.translations = None
+# gettext (this needs to default to English so it doesn't break
+#   in case we're running a script without the app like
+#   ./bin/gmg theme assetlink)
+thread_scope.translations = gettext.translation(
+    'mediagoblin',
+    pkg_resources.resource_filename(
+        'mediagoblin', 'i18n'), ['en'], fallback=True)
 
 # app and global config objects
 app_config = None