From c2b68f5c26205eab39564111f5157cbd3cf5ecd5 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Mon, 16 Jan 2006 14:54:15 +0000 Subject: [PATCH] magic-removal: changed explicit settings import to qualified settings import git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1988 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/text.py | 4 ++-- django/utils/translation.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/django/utils/text.py b/django/utils/text.py index ce1225b83c..7b6e1182ab 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -1,6 +1,6 @@ import re -from django.conf.settings import DEFAULT_CHARSET +from django.conf import settings # Capitalizes the first letter of a string. capfirst = lambda x: x and x[0].upper() + x[1:] @@ -100,7 +100,7 @@ def javascript_quote(s): return r"\u%04x" % ord(match.group(1)) if type(s) == str: - s = s.decode(DEFAULT_CHARSET) + s = s.decode(settings.DEFAULT_CHARSET) elif type(s) != unicode: raise TypeError, s s = s.replace('\\', '\\\\') diff --git a/django/utils/translation.py b/django/utils/translation.py index 351a1bd3cd..01568d1969 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -209,8 +209,8 @@ def get_language(): except AttributeError: pass # If we don't have a real translation object, assume it's the default language. - from django.conf.settings import LANGUAGE_CODE - return LANGUAGE_CODE + from django.conf import settings + return settings.LANGUAGE_CODE def catalog(): """ @@ -346,16 +346,16 @@ def get_date_formats(): technical message ID to store date and time formats. If it doesn't contain one, the formats provided in the settings will be used. """ - from django.conf.settings import DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT + from django.conf import settings date_format = _('DATE_FORMAT') datetime_format = _('DATETIME_FORMAT') time_format = _('TIME_FORMAT') if date_format == 'DATE_FORMAT': - date_format = DATE_FORMAT + date_format = settings.DATE_FORMAT if datetime_format == 'DATETIME_FORMAT': - datetime_format = DATETIME_FORMAT + datetime_format = settings.DATETIME_FORMAT if time_format == 'TIME_FORMAT': - time_format = TIME_FORMAT + time_format = settings.TIME_FORMAT return (date_format, datetime_format, time_format) def install(): @@ -466,4 +466,4 @@ def string_concat(*strings): """ return ''.join([str(el) for el in strings]) -string_concat = lazy(string_concat, str) \ No newline at end of file +string_concat = lazy(string_concat, str)