Author: mtredinnick
Date: 2008-07-19 14:32:18 -0500 (Sat, 19 Jul 2008)
New Revision: 7993

Added:
   django/trunk/django/utils/thread_support.py
Modified:
   django/trunk/django/utils/translation/trans_real.py
Log:
Starting to do the reverse() threading stuff.


Added: django/trunk/django/utils/thread_support.py
===================================================================
--- django/trunk/django/utils/thread_support.py                         (rev 0)
+++ django/trunk/django/utils/thread_support.py 2008-07-19 19:32:18 UTC (rev 
7993)
@@ -0,0 +1,12 @@
+"""
+Code used in a couple of places to work with the current thread's environment.
+Current users include i18n and request prefix handling.
+"""
+
+try:
+    import threading
+    currentThread = threading.currentThread
+except ImportError:
+    def currentThread():
+        return "no threading"
+

Modified: django/trunk/django/utils/translation/trans_real.py
===================================================================
--- django/trunk/django/utils/translation/trans_real.py 2008-07-19 19:32:12 UTC 
(rev 7992)
+++ django/trunk/django/utils/translation/trans_real.py 2008-07-19 19:32:18 UTC 
(rev 7993)
@@ -8,19 +8,8 @@
 from cStringIO import StringIO
 
 from django.utils.safestring import mark_safe, SafeData
+from django.utils.thread_support import currentThread
 
-try:
-    import threading
-    hasThreads = True
-except ImportError:
-    hasThreads = False
-
-if hasThreads:
-    currentThread = threading.currentThread
-else:
-    def currentThread():
-        return 'no threading'
-
 # Translations are cached in a dictionary for every language+app tuple.
 # The active translations are stored by threadid to make them thread local.
 _translations = {}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to