Skip to content

Commit 1654988

Browse files
committed
Replace patched Django 1.2.7 with Django 1.6
- Legacy-Id: 6871
1 parent e3253b4 commit 1654988

3,734 files changed

Lines changed: 351892 additions & 306995 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

django/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

django/__init__.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
VERSION = (1, 2, 7, 'final', 0)
1+
VERSION = (1, 6, 0, 'final', 0)
22

3-
def get_version():
4-
version = '%s.%s' % (VERSION[0], VERSION[1])
5-
if VERSION[2]:
6-
version = '%s.%s' % (version, VERSION[2])
7-
if VERSION[3:] == ('alpha', 0):
8-
version = '%s pre-alpha' % version
9-
else:
10-
if VERSION[3] != 'final':
11-
version = '%s %s %s' % (version, VERSION[3], VERSION[4])
12-
from django.utils.version import get_svn_revision
13-
svn_rev = get_svn_revision()
14-
if svn_rev != u'SVN-unknown':
15-
version = "%s %s" % (version, svn_rev)
16-
return version
3+
def get_version(*args, **kwargs):
4+
# Don't litter django/__init__.py with all the get_version stuff.
5+
# Only import if it's actually called.
6+
from django.utils.version import get_version
7+
return get_version(*args, **kwargs)

django/bin/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

django/bin/compile-messages.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

django/bin/daily_cleanup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
sessions at the moment).
88
"""
99

10+
import warnings
11+
1012
from django.core import management
1113

1214
if __name__ == "__main__":
13-
management.call_command('cleanup')
15+
warnings.warn(
16+
"The `daily_cleanup` script has been deprecated "
17+
"in favor of `django-admin.py clearsessions`.",
18+
DeprecationWarning)
19+
management.call_command('clearsessions')

django/bin/django-2to3.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
3+
# This works exactly like 2to3, except that it uses Django's fixers rather
4+
# than 2to3's built-in fixers.
5+
6+
import sys
7+
from lib2to3.main import main
8+
9+
sys.exit(main("django.utils.2to3_fixes"))
10+

django/bin/make-messages.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

django/bin/profiling/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

django/bin/profiling/gather_profile_stats.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"""
99

1010
from hotshot import stats
11+
import os
1112
import pstats
12-
import sys, os
13+
import sys
1314

1415
def gather_stats(p):
1516
profiles = {}
@@ -23,7 +24,7 @@ def gather_stats(p):
2324
prof = stats.load(os.path.join(p, f))
2425
else:
2526
continue
26-
print "Processing %s" % f
27+
print("Processing %s" % f)
2728
if path in profiles:
2829
profiles[path].add(prof)
2930
else:

django/bin/unique-messages.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def unique_messages():
1111
elif os.path.isdir('locale'):
1212
basedir = os.path.abspath('locale')
1313
else:
14-
print "this script should be run from the django svn tree or your project or app tree"
14+
print("This script should be run from the Django Git tree or your project or app tree.")
1515
sys.exit(1)
1616

1717
for (dirpath, dirnames, filenames) in os.walk(basedir):
@@ -22,7 +22,8 @@ def unique_messages():
2222
cmd = 'msguniq "%s.po"' % pf
2323
stdout = os.popen(cmd)
2424
msg = stdout.read()
25-
open('%s.po' % pf, 'w').write(msg)
25+
with open('%s.po' % pf, 'w') as fp:
26+
fp.write(msg)
2627

2728
if __name__ == "__main__":
2829
unique_messages()

0 commit comments

Comments
 (0)