Django

Code

Changeset 6525

Show
Ignore:
Timestamp:
10/16/07 11:54:23 (9 months ago)
Author:
jbronn
Message:

Merged revisions 6442-6524 via svnmerge from trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis

    • Property svnmerge-integrated changed from /django/trunk:1-6441 to /django/trunk:1-6524
  • django/branches/gis/AUTHORS

    r6442 r6525  
    314314    Milton Waddams 
    315315    wam-djangobug@wamber.net 
    316     wangchun <yaohua2000@gmail.com
     316    Wang Chun <wangchun@exoweb.net
    317317    Filip Wasilewski <filip.wasilewski@gmail.com> 
    318318    Dan Watson <http://theidioteque.net/> 
  • django/branches/gis/django/bin/compile-messages.py

    r6394 r6525  
    1515    if os.environ.get('DJANGO_SETTINGS_MODULE'): 
    1616        from django.conf import settings 
    17         basedirs += settings.LOCALE_PATHS 
     17        if hasattr(settings, 'LOCALE_PATHS'): 
     18            basedirs += settings.LOCALE_PATHS 
    1819 
    1920    # Gather existing directories. 
  • django/branches/gis/django/bin/make-messages.py

    r6018 r6525  
    7575            os.unlink(potfile) 
    7676 
     77        all_files = [] 
    7778        for (dirpath, dirnames, filenames) in os.walk("."): 
    78             for file in filenames: 
    79                 if domain == 'djangojs' and file.endswith('.js'): 
    80                     if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) 
     79            all_files.extend([(dirpath, f) for f in filenames]) 
     80        all_files.sort() 
     81        for dirpath, file in all_files: 
     82            if domain == 'djangojs' and file.endswith('.js'): 
     83                if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) 
     84                src = open(os.path.join(dirpath, file), "rb").read() 
     85                src = pythonize_re.sub('\n#', src) 
     86                open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) 
     87                thefile = '%s.py' % file 
     88                cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( 
     89                    os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) 
     90                (stdin, stdout, stderr) = os.popen3(cmd, 't') 
     91                msgs = stdout.read() 
     92                errors = stderr.read() 
     93                if errors: 
     94                    print "errors happened while running xgettext on %s" % file 
     95                    print errors 
     96                    sys.exit(8) 
     97                old = '#: '+os.path.join(dirpath, thefile)[2:] 
     98                new = '#: '+os.path.join(dirpath, file)[2:] 
     99                msgs = msgs.replace(old, new) 
     100                if msgs: 
     101                    open(potfile, 'ab').write(msgs) 
     102                os.unlink(os.path.join(dirpath, thefile)) 
     103            elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')): 
     104                thefile = file 
     105                if file.endswith('.html'): 
    81106                    src = open(os.path.join(dirpath, file), "rb").read() 
    82                     src = pythonize_re.sub('\n#', src) 
    83                     open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) 
    84107                    thefile = '%s.py' % file 
    85                     cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( 
    86                         os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) 
    87                     (stdin, stdout, stderr) = os.popen3(cmd, 't') 
    88                     msgs = stdout.read() 
    89                     errors = stderr.read() 
    90                     if errors: 
    91                         print "errors happened while running xgettext on %s" % file 
    92                         print errors 
    93                         sys.exit(8) 
     108                    open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) 
     109                if verbose: 
     110                    sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) 
     111                cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( 
     112                    domain, os.path.join(dirpath, thefile)) 
     113                (stdin, stdout, stderr) = os.popen3(cmd, 't') 
     114                msgs = stdout.read() 
     115                errors = stderr.read() 
     116                if errors: 
     117                    print "errors happened while running xgettext on %s" % file 
     118                    print errors 
     119                    sys.exit(8) 
     120                if thefile != file: 
    94121                    old = '#: '+os.path.join(dirpath, thefile)[2:] 
    95122                    new = '#: '+os.path.join(dirpath, file)[2:] 
    96123                    msgs = msgs.replace(old, new) 
    97                     if msgs: 
    98                         open(potfile, 'ab').write(msgs) 
     124                if os.path.exists(potfile): 
     125                    # Strip the header 
     126                    msgs = '\n'.join(dropwhile(len, msgs.split('\n'))) 
     127                else: 
     128                    msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8') 
     129                if msgs: 
     130                    open(potfile, 'ab').write(msgs) 
     131                if thefile != file: 
    99132                    os.unlink(os.path.join(dirpath, thefile)) 
    100                 elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')): 
    101                     thefile = file 
    102                     if file.endswith('.html'): 
    103                         src = open(os.path.join(dirpath, file), "rb").read() 
    104                         thefile = '%s.py' % file 
    105                         open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) 
    106                     if verbose: 
    107                         sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) 
    108                     cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( 
    109                         domain, os.path.join(dirpath, thefile)) 
    110                     (stdin, stdout, stderr) = os.popen3(cmd, 't') 
    111                     msgs = stdout.read() 
    112                     errors = stderr.read() 
    113                     if errors: 
    114                         print "errors happened while running xgettext on %s" % file 
    115                         print errors 
    116                         sys.exit(8) 
    117                     if thefile != file: 
    118                         old = '#: '+os.path.join(dirpath, thefile)[2:] 
    119                         new = '#: '+os.path.join(dirpath, file)[2:] 
    120                         msgs = msgs.replace(old, new) 
    121                     if os.path.exists(potfile): 
    122                         # Strip the header 
    123                         msgs = '\n'.join(dropwhile(len, msgs.split('\n'))) 
    124                     else: 
    125                         msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8') 
    126                     if msgs: 
    127                         open(potfile, 'ab').write(msgs) 
    128                     if thefile != file: 
    129                         os.unlink(os.path.join(dirpath, thefile)) 
    130133 
    131134        if os.path.exists(potfile): 
  • django/branches/gis/django/conf/locale/de/LC_MESSAGES/django.po

    r6018 r6525  
    1 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 
    2 # This file is distributed under the same license as the PACKAGE package. 
    3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 
     1# Translation of django.po to German 
     2
     3# Copyright (C) 2005-2007, 
     4# This file is distributed under the same license as the django package. 
    45# 
    56msgid "" 
     
    16301631msgstr "Webseiten" 
    16311632 
    1632 #: contrib/humanize/templatetags/humanize.py:17 
     1633#: contrib/humanize/templatetags/humanize.py:20 
    16331634msgid "th" 
    1634 msgstr "
    1635  
    1636 #: contrib/humanize/templatetags/humanize.py:17 
     1635msgstr ".
     1636 
     1637#: contrib/humanize/templatetags/humanize.py:20 
    16371638msgid "st" 
    1638 msgstr "
    1639  
    1640 #: contrib/humanize/templatetags/humanize.py:17 
     1639msgstr ".
     1640 
     1641#: contrib/humanize/templatetags/humanize.py:20 
    16411642msgid "nd" 
    1642 msgstr "
    1643  
    1644 #: contrib/humanize/templatetags/humanize.py:17 
     1643msgstr ".
     1644 
     1645#: contrib/humanize/templatetags/humanize.py:20 
    16451646msgid "rd" 
    1646 msgstr "
    1647  
    1648 #: contrib/humanize/templatetags/humanize.py:47 
     1647msgstr ".
     1648 
     1649#: contrib/humanize/templatetags/humanize.py:50 
    16491650#, python-format 
    16501651msgid "%(value).1f million" 
    16511652msgid_plural "%(value).1f million" 
    1652 msgstr[0] "
    1653 msgstr[1] "
    1654  
    1655 #: contrib/humanize/templatetags/humanize.py:50 
     1653msgstr[0] "%(value).1f Million
     1654msgstr[1] "%(value).1f Millionen
     1655 
     1656#: contrib/humanize/templatetags/humanize.py:53 
    16561657#, python-format 
    16571658msgid "%(value).1f billion" 
    16581659msgid_plural "%(value).1f billion" 
    1659 msgstr[0] "
    1660 msgstr[1] "
    1661  
    1662 #: contrib/humanize/templatetags/humanize.py:53 
     1660msgstr[0] "%(value).1f Milliarde
     1661msgstr[1] "%(value).1f Milliarden
     1662 
     1663#: contrib/humanize/templatetags/humanize.py:56 
    16631664#, python-format 
    16641665msgid "%(value).1f trillion" 
    16651666msgid_plural "%(value).1f trillion" 
    1666 msgstr[0] "
    1667 msgstr[1] "
    1668  
    1669 #: contrib/humanize/templatetags/humanize.py:68 
     1667msgstr[0] "%(value).1f Billion
     1668msgstr[1] "%(value).1f Billionen
     1669 
     1670#: contrib/humanize/templatetags/humanize.py:71 
    16701671msgid "one" 
    16711672msgstr "ein" 
    16721673 
    1673 #: contrib/humanize/templatetags/humanize.py:68 
     1674#: contrib/humanize/templatetags/humanize.py:71 
    16741675msgid "two" 
    16751676msgstr "zwei" 
    16761677 
    1677 #: contrib/humanize/templatetags/humanize.py:68 
     1678#: contrib/humanize/templatetags/humanize.py:71 
    16781679msgid "three" 
    16791680msgstr "drei" 
    16801681 
    1681 #: contrib/humanize/templatetags/humanize.py:68 
     1682#: contrib/humanize/templatetags/humanize.py:71 
    16821683msgid "four" 
    16831684msgstr "vier" 
    16841685 
    1685 #: contrib/humanize/templatetags/humanize.py:68 
     1686#: contrib/humanize/templatetags/humanize.py:71 
    16861687msgid "five" 
    16871688msgstr "fÃŒnf" 
    16881689 
    1689 #: contrib/humanize/templatetags/humanize.py:68 
     1690#: contrib/humanize/templatetags/humanize.py:71 
    16901691msgid "six" 
    16911692msgstr "sechs" 
    16921693 
    1693 #: contrib/humanize/templatetags/humanize.py:68 
     1694#: contrib/humanize/templatetags/humanize.py:71 
    16941695msgid "seven" 
    16951696msgstr "sieben" 
    16961697 
    1697 #: contrib/humanize/templatetags/humanize.py:68 
     1698#: contrib/humanize/templatetags/humanize.py:71 
    16981699msgid "eight" 
    16991700msgstr "acht" 
    17001701 
    1701 #: contrib/humanize/templatetags/humanize.py:68 
     1702#: contrib/humanize/templatetags/humanize.py:71 
    17021703msgid "nine" 
    17031704msgstr "neun" 
  • django/branches/gis/django/core/handlers/modpython.py

    r6394 r6525  
    1515    def __init__(self, req): 
    1616        self._req = req 
    17         self.path = force_unicode(req.uri
     17        self.path = force_unicode(req.uri, errors='ignore'
    1818 
    1919    def __repr__(self): 
  • django/branches/gis/django/core/handlers/wsgi.py

    r6442 r6525  
    7676    def __init__(self, environ): 
    7777        self.environ = environ 
    78         self.path = force_unicode(environ['PATH_INFO']
     78        self.path = force_unicode(environ['PATH_INFO'], errors='ignore'
    7979        self.META = environ 
    8080        self.method = environ['REQUEST_METHOD'].upper() 
  • django/branches/gis/django/core/management/base.py

    r6442 r6525  
     1import os 
     2import sys 
     3from optparse import make_option, OptionParser 
     4 
    15import django 
    26from django.core.exceptions import ImproperlyConfigured 
    37from django.core.management.color import color_style 
    4 import itertools 
    5 from optparse import make_option, OptionParser 
    6 import sys 
    7 import os 
    88 
    99class CommandError(Exception): 
     
    2020    if options.pythonpath: 
    2121        sys.path.insert(0, options.pythonpath) 
    22                  
     22 
    2323class BaseCommand(object): 
    2424    # Metadata about this command. 
     
    162162 
    163163    def handle(self, *args, **options): 
    164         from django.db import models 
    165         if len(args) != 0: 
     164        if args: 
    166165            raise CommandError("Command doesn't accept any arguments") 
    167  
    168166        return self.handle_noargs(**options) 
    169167 
     
    172170 
    173171def copy_helper(style, app_or_project, name, directory, other_name=''): 
    174     import django 
     172    """ 
     173    Copies either a Django application layout template or a Django project 
     174    layout template into the specified directory. 
     175 
     176    * style - A color style object (see django.core.management.color). 
     177    * app_or_project - The string 'app' or 'project'. 
     178    * name - The name of the application or project. 
     179    * directory - The directory to copy the layout template to. 
     180    * other_name - When copying an application layout, this should be the name 
     181                   of the project. 
     182    """ 
    175183    import re 
    176184    import shutil 
     
    222230        new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR 
    223231        os.chmod(filename, new_permissions) 
    224  
  • django/branches/gis/django/core/management/color.py

    r6394 r6525  
    33""" 
    44 
    5 from django.utils import termcolors 
    65import sys 
    76 
     7from django.utils import termcolors 
     8 
    89def color_style(): 
    9     "Returns a Style object with the Django color scheme." 
    10     if sys.platform == 'win32' or sys.platform == 'Pocket PC' or sys.platform.startswith('java') or not sys.stdout.isatty(): 
     10    """Returns a Style object with the Django color scheme.""" 
     11    if (sys.platform == 'win32' or sys.platform == 'Pocket PC' 
     12        or sys.platform.startswith('java') or not sys.stdout.isatty()): 
    1113        return no_style() 
    1214    class dummy: pass 
     
    2224 
    2325def no_style(): 
    24     "Returns a Style object that has no colors.
     26    """Returns a Style object that has no colors.""
    2527    class dummy: 
    2628        def __getattr__(self, attr): 
  • django/branches/gis/django/core/management/commands/runserver.py

    r6394 r6525  
    2121        from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException 
    2222        from django.core.handlers.wsgi import WSGIHandler 
    23         if len(args) != 0
     23        if args
    2424            raise CommandError('Usage is runserver %s' % self.args) 
    2525        if not addrport: 
  • django/branches/gis/django/core/management/commands/startapp.py

    r6018 r6525  
    1717        # Determine the project_name a bit naively -- by looking at the name of 
    1818        # the parent directory. 
    19         project_dir = os.path.normpath(os.path.join(directory, '..')) 
     19        project_dir = os.path.normpath(os.path.join(directory, os.pardir)) 
    2020        parent_dir = os.path.basename(project_dir) 
    2121        project_name = os.path.basename(directory) 
  • django/branches/gis/django/core/management/__init__.py

    r6442 r6525  
    240240    project_name = os.path.basename(project_directory) 
    241241    settings_name = os.path.splitext(settings_filename)[0] 
    242     sys.path.append(os.path.join(project_directory, '..')) 
     242    sys.path.append(os.path.join(project_directory, os.pardir)) 
    243243    project_module = __import__(project_name, {}, {}, ['']) 
    244244    sys.path.pop() 
  • django/branches/gis/django/db/backends/postgresql/operations.py

    r6021 r6525  
    101101                    style.SQL_KEYWORD('IS NOT'), 
    102102                    style.SQL_KEYWORD('FROM'), 
    103                     style.SQL_TABLE(f.m2m_db_table()))) 
     103                    style.SQL_TABLE(qn(f.m2m_db_table())))) 
    104104        return output 
  • django/branches/gis/django/db/models/fields/__init__.py

    r6394 r6525  
    239239            if callable(self.default): 
    240240                return self.default() 
    241             return self.default 
     241            return force_unicode(self.default, strings_only=True) 
    242242        if not self.empty_strings_allowed or (self.null and settings.DATABASE_ENGINE != 'oracle'): 
    243243            return None 
  • django/branches/gis/django/http/__init__.py

    r6394 r6525  
    4848        "Returns the HTTP host using the environment or request headers." 
    4949        # We try three options, in order of decreasing preference. 
    50         host = self.META.get('HTTP_X_FORWARDED_HOST', '') 
    51         if 'HTTP_HOST' in self.META: 
     50        if 'HTTP_X_FORWARDED_HOST' in self.META: 
     51            host = self.META['HTTP_X_FORWARDED_HOST'] 
     52        elif 'HTTP_HOST' in self.META: 
    5253            host = self.META['HTTP_HOST'] 
    5354        else: 
  • django/branches/gis/django/newforms/widgets.py

    r6394 r6525  
    88    from sets import Set as set   # Python 2.3 fallback 
    99 
     10import copy 
    1011from itertools import chain 
     12 
    1113from django.utils.datastructures import MultiValueDict 
    1214from django.utils.html import escape 
     
    3335            self.attrs = {} 
    3436 
     37    def __deepcopy__(self, memo): 
     38        obj = copy.copy(self) 
     39        obj.attrs = self.attrs.copy() 
     40        memo[id(self)] = obj 
     41        return obj 
     42 
    3543    def render(self, name, value, attrs=None): 
    3644        """ 
     
    8997 
    9098    def __init__(self, attrs=None, render_value=True): 
    91         self.attrs = attrs or {} 
     99        super(PasswordInput, self).__init__(attrs) 
    92100        self.render_value = render_value 
    93101 
     
    106114    """ 
    107115    def __init__(self, attrs=None, choices=()): 
     116        super(MultipleHiddenInput, self).__init__(attrs) 
    108117        # choices can be any iterable 
    109         self.attrs = attrs or {} 
    110118        self.choices = choices 
    111119 
     
    146154class CheckboxInput(Widget): 
    147155    def __init__(self, attrs=None, check_test=bool): 
     156        super(CheckboxInput, self).__init__(attrs) 
    148157        # check_test is a callable that takes a value and returns True 
    149158        # if the checkbox should be checked for that value. 
    150         self.attrs = attrs or {} 
    151159        self.check_test = check_test 
    152160 
     
    165173class Select(Widget): 
    166174    def __init__(self, attrs=None, choices=()): 
    167         self.attrs = attrs or {} 
     175        super(Select, self).__init__(attrs) 
    168176        # choices can be any iterable, but we may need to render this widget 
    169177        # multiple times. Thus, collapse it into a list so it can be consumed 
     
    204212class SelectMultiple(Widget): 
    205213    def __init__(self, attrs=None, choices=()): 
     214        super(SelectMultiple, self).__init__(attrs) 
    206215        # choices can be any iterable 
    207         self.attrs = attrs or {} 
    208216        self.choices = choices 
    209217 
  • django/branches/gis/django/oldforms/__init__.py

    r6394 r6525  
    501501            if smart_unicode(value) == str_data: 
    502502                selected_html = u' selected="selected"' 
    503             output.append(u'    <option value="%s"%s>%s</option>' % (escape(value), selected_html, escape(display_name))) 
     503            output.append(u'    <option value="%s"%s>%s</option>' % (escape(value), selected_html, force_unicode(escape(display_name)))) 
    504504        output.append(u'  </select>') 
    505505        return u'\n'.join(output) 
     
    613613            if smart_unicode(value) in str_data_list: 
    614614                selected_html = u' selected="selected"' 
    615             output.append(u'    <option value="%s"%s>%s</option>' % (escape(value), selected_html, escape(choice))) 
     615            output.append(u'    <option value="%s"%s>%s</option>' % (escape(value), selected_html, force_unicode(escape(choice)))) 
    616616        output.append(u'  </select>') 
    617617        return u'\n'.join(output) 
  • django/branches/gis/django/utils/datastructures.py

    r6394 r6525  
    5555        if data is None: data = {} 
    5656        dict.__init__(self, data) 
    57         self.keyOrder = data.keys() 
     57        if isinstance(data, dict): 
     58            self.keyOrder = data.keys() 
     59        else: 
     60            self.keyOrder=[key for key, value in data] 
    5861 
    5962    def __setitem__(self, key, value): 
  • django/branches/gis/django/utils/translation/__init__.py

    r6018 r6525  
    33""" 
    44from django.utils.functional import lazy 
     5from django.utils.encoding import force_unicode 
    56 
    67__all__ = ['gettext', 'gettext_noop', 'gettext_lazy', 'ngettext', 
     
    4041 
    4142    # Make the originally requested function call on the way out the door. 
    42     return g[caller](*args, **kwargs) 
     43    return g['real_%s' % caller](*args, **kwargs) 
    4344 
    4445g = globals() 
     
    6465    return real_ungettext(singular, plural, number) 
    6566 
    66 def string_concat(*strings): 
    67     return real_string_concat(*strings) 
    68  
    6967ngettext_lazy = lazy(ngettext, str) 
    7068gettext_lazy = lazy(gettext, str) 
    7169ungettext_lazy = lazy(ungettext, unicode) 
    7270ugettext_lazy = lazy(ugettext, unicode) 
    73 string_concat = lazy(string_concat, unicode) 
    7471 
    7572def activate(language): 
     
    109106    return real_deactivate_all() 
    110107 
     108def string_concat(*strings): 
     109    """ 
     110    Lazy variant of string concatenation, needed for translations that are 
     111    constructed from multiple parts. 
     112    """ 
     113    return u''.join([force_unicode(s) for s in strings]) 
     114string_concat = lazy(string_concat, unicode) 
  • django/branches/gis/django/utils/translation/trans_null.py

    r6018 r6525  
    1414    return force_unicode(ngettext(singular, plural, number)) 
    1515 
    16 string_concat = lambda *strings: u''.join([force_unicode(el) for el in strings]) 
    1716activate = lambda x: None 
    1817deactivate = deactivate_all = install = lambda: None 
  • django/branches/gis/django/utils/translation/trans_real.py

    r6394 r6525  
    517517    return out.getvalue() 
    518518 
    519 def string_concat(*strings): 
    520     """" 
    521     Lazy variant of string concatenation, needed for translations that are 
    522     constructed from multiple parts. 
    523     """ 
    524     return u''.join([force_unicode(s) for s in strings]) 
  • django/branches/gis/django/views/static.py

    r5540 r6525  
    1 from django.template import loader 
    2 from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified 
    3 from django.template import Template, Context, TemplateDoesNotExist 
     1""" 
     2Views and functions for serving static files.  These are only to be used 
     3during development, and SHOULD NOT be used in a production setting. 
     4""" 
     5 
    46import mimetypes 
    57import os 
     
    911import stat 
    1012import urllib 
     13 
     14from django.template import loader 
     15from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified 
     16from django.template import Template, Context, TemplateDoesNotExist 
    1117 
    1218def serve(request, path, document_root=None, show_indexes=False): 
     
    3036    for part in path.split('/'): 
    3137        if not part: 
    32             # strip empty path components 
     38            # Strip empty path components. 
    3339            continue 
    3440        drive, part = os.path.splitdrive(part) 
    3541        head, part = os.path.split(part) 
    3642        if part in (os.curdir, os.pardir): 
    37             # strip '.' amd '..' in path 
     43            # Strip '.' and '..' in path. 
    3844            continue 
    3945        newpath = os.path.join(newpath, part).replace('\\', '/') 
  • django/branches/gis/docs/databases.txt

    r6442 r6525  
    176176 
    177177To run ``python manage.py syncdb``, you'll need to create an Oracle database 
    178 user with CREATE TABLE, CREATE SEQUENCE, and CREATE PROCEDURE privileges.  To 
    179 run Django's test suite, the user also needs CREATE and DROP DATABASE and 
    180 CREATE and DROP TABLESPACE privileges. 
     178user with CREATE TABLE, CREATE SEQUENCE, CREATE PROCEDURE, and CREATE TRIGGER 
     179privileges.  To run Django's test suite, the user also needs  
     180CREATE and DROP DATABASE and CREATE and DROP TABLESPACE privileges. 
    181181 
    182182Connecting to the Database 
  • django/branches/gis/docs/i18n.txt

    r6394 r6525  
    457457.. admonition:: Mind your charset 
    458458 
    459     When creating a ``.po`` file with your favorite text editor, first edit 
     459    When creating a PO file with your favorite text editor, first edit 
    460460    the charset line (search for ``"CHARSET"``) and set it to the charset 
    461     you'll be using to edit the content. Generally, utf-8 should work for most 
    462     languages, but ``gettext`` should handle any charset you throw at it. 
     461    you'll be using to edit the content. Due to the way the ``gettext`` tools 
     462    work internally and because we want to allow non-ASCII source strings in 
     463    Django's core and your applications, you **must** use UTF-8 as the encoding 
     464    for your PO file (this means that everybody will be using the same 
     465    encoding, which is important when Django processes the PO files). 
    463466 
    464467To reexamine all source code and templates for new translation strings and 
  • django/branches/gis/docs/newforms.txt

    r6442 r6525  
    20762076 
    20772077That's all the documentation for now. For more, see the file 
    2078 http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/tests.py 
     2078http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms 
    20792079-- the unit tests for ``django.newforms``. This can give you a good idea of 
    2080 what's possible. 
     2080what's possible. (Each submodule there contains separate tests.) 
    20812081 
    20822082If you're really itching to learn and use this library, please be patient. 
  • django/branches/gis/docs/request_response.txt

    r6394 r6525  
    382382    but since this is actually the value included in the HTTP ``Content-Type`` 
    383383    header, it can also include the character set encoding, which makes it 
    384     more than just a MIME type specification. If ``mimetype`` is specifiedi 
    385     (not None), that value is used. Otherwise, ``content_type`` is used. If 
     384    more than just a MIME type specification. If ``mimetype`` is specified 
     385    (not None), that value is used. Otherwise, ``content_type`` is used. If 
    386386    neither is given, the ``DEFAULT_CONTENT_TYPE`` setting is used. 
    387387 
  • django/branches/gis/docs/templates_python.txt

    r6442 r6525  
    317317        return t.render(c) 
    318318 
    319 Note:: 
     319.. note:: 
    320320    If you're using Django's ``render_to_response()`` shortcut to populate a 
    321321    template with the contents of a dictionary, your template will be passed a 
  • django/branches/gis/docs/unicode.txt

    r6018 r6525  
    111111for converting back and forth between Unicode and bytestrings. 
    112112 
    113     * ``smart_unicode(s, encoding='utf-8', errors='strict')`` converts its 
    114       input to a Unicode string. The ``encoding`` parameter specifies the input 
    115       encoding. (For example, Django uses this internally when processing form 
    116       input data, which might not be UTF-8 encoded.) The ``errors`` parameter 
    117       takes any of the values that are accepted by Python's ``unicode()`` 
    118       function for its error handling. 
     113    * ``smart_unicode(s, encoding='utf-8', strings_only=False, errors='strict')`` 
     114      converts its input to a Unicode string. The ``encoding`` parameter 
     115      specifies the input encoding. (For example, Django uses this internally 
     116      when processing form input data, which might not be UTF-8 encoded.) The 
     117      ``strings_only`` parameter, if set to True, will result in Python 
     118      numbers, booleans and ``None`` not being converted to a string (they keep 
     119      their original types). The ``errors`` parameter takes any of the values 
     120      that are accepted by Python's ``unicode()`` function for its error 
     121      handling. 
    119122 
    120123      If you pass ``smart_unicode()`` an object that has a ``__unicode__`` 
    121124      method, it will use that method to do the conversion. 
    122125 
    123     * ``force_unicode(s, encoding='utf-8', errors='strict')`` is identical to 
    124       ``smart_unicode()`` in almost all cases. The difference is when th
    125       first argument is a `lazy translation`_ instance. While 
     126    * ``force_unicode(s, encoding='utf-8', strings_only=False, errors='strict')`` 
     127      is identical to ``smart_unicode()`` in almost all cases. The differenc
     128      is when the first argument is a `lazy translation`_ instance. While 
    126129      ``smart_unicode()`` preserves lazy translations, ``force_unicode()`` 
    127130      forces those objects to a Unicode string (causing the translation to 
     
    133136    * ``smart_str(s, encoding='utf-8', strings_only=False, errors='strict')`` 
    134137      is essentially the opposite of ``smart_unicode()``. It forces the first 
    135       argument to a bytestring. The ``strings_only`` parameter, if set to True, 
    136       will result in Python integers, booleans and ``None`` not being 
    137       converted to a string (they keep their original types). This is slightly 
    138       different semantics from Python's builtin ``str()`` function, but the 
    139       difference is needed in a few places within Django's internals. 
     138      argument to a bytestring. The ``strings_only`` parameter has the same 
     139      behaviour as for ``smart_unicode()`` and ``force_unicode()``. This is 
     140      slightly different semantics from Python's builtin ``str()`` function, 
     141      but the difference is needed in a few places within Django's internals. 
    140142 
    141143Normally, you'll only need to use ``smart_unicode()``. Call it as early as 
  • django/branches/gis/tests/modeltests/basic/models.py

    r6394 r6525  
    153153>>> a6.save() 
    154154>>> a6.headline 
    155 'Default headline' 
     155u'Default headline' 
    156156 
    157157# For DateTimeFields, Django saves as much precision (in seconds) as you 
  • django/branches/gis/tests/modeltests/field_defaults/models.py

    r6018 r6525  
    4343# Access database columns via Python attributes. 
    4444>>> a.headline 
    45 'Default headline' 
     45u'Default headline' 
    4646 
    4747# make sure the two dates are sufficiently close 
  • django/branches/gis/tests/regressiontests/datastructures/tests.py

    r6018 r6525  
    5656{'one': 'not one', 'two': 'two', 'three': 'three'} 
    5757 
     58</