Browse Source

Dropped useless prefixes from threads.

Ralfp 12 years ago
parent
commit
42aae218b8
2 changed files with 9 additions and 9 deletions
  1. 3 3
      misago/template/middlewares.py
  2. 6 6
      misago/template/theme.py

+ 3 - 3
misago/template/middlewares.py

@@ -35,9 +35,9 @@ def process_context(templates, dictionary=None, context_instance=None):
     """
     """
     Put template context trough template middlewares
     Put template context trough template middlewares
     """
     """
-    if _thread_local.misago_template_mutex:
+    if _thread_local.template_mutex:
         return context
         return context
-    _thread_local.misago_template_mutex = True
+    _thread_local.template_mutex = True
 
 
     for middleware in _middlewares:
     for middleware in _middlewares:
         try:
         try:
@@ -47,7 +47,7 @@ def process_context(templates, dictionary=None, context_instance=None):
         except AttributeError:
         except AttributeError:
             pass
             pass
 
 
-    _thread_local.misago_template_mutex = None
+    _thread_local.template_mutex = None
     return context
     return context
 
 
 
 

+ 6 - 6
misago/template/theme.py

@@ -15,17 +15,17 @@ def activate_theme(theme):
     if theme[0] == '_':
     if theme[0] == '_':
         raise ValueError('"%s" is a template package, not a theme.' % theme[1:])
         raise ValueError('"%s" is a template package, not a theme.' % theme[1:])
     
     
-    _thread_local.misago_theme = theme;
-    _thread_local.misago_template_mutex = False
+    _thread_local.theme = theme;
+    _thread_local.template_mutex = False
 
 
 
 
 def reset_theme():
 def reset_theme():
-    _thread_local.misago_theme = settings.INSTALLED_THEMES[0];
+    _thread_local.theme = settings.INSTALLED_THEMES[0];
 
 
 
 
 def active_theme():
 def active_theme():
     try:
     try:
-        return _thread_local.misago_theme
+        return _thread_local.theme
     except AttributeError:
     except AttributeError:
         return None
         return None
 
 
@@ -33,10 +33,10 @@ def active_theme():
 def prefix_templates(templates, dictionary=None):
 def prefix_templates(templates, dictionary=None):
     templates = process_templates(templates, dictionary)
     templates = process_templates(templates, dictionary)
     if isinstance(templates, str):
     if isinstance(templates, str):
-        return ('%s/%s' % (_thread_local.misago_theme, templates), templates)
+        return ('%s/%s' % (_thread_local.theme, templates), templates)
     else:
     else:
         prefixed = []
         prefixed = []
         for template in templates:
         for template in templates:
-            prefixed.append('%s/%s' % (_thread_local.misago_theme, template))
+            prefixed.append('%s/%s' % (_thread_local.theme, template))
         prefixed += templates
         prefixed += templates
         return tuple(prefixed)
         return tuple(prefixed)