diff options
| author | Tim Graham <timograham@gmail.com> | 2015-02-06 06:22:00 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-06 06:22:00 -0500 |
| commit | 607af78bb82404d55cc3e80e5f6772fb87c168ee (patch) | |
| tree | 92c8709a129bdbae670ffecc9c29a1cb4c62f16f | |
| parent | bbe28496d32f76ca161f5c33787d6ad62267fcc6 (diff) | |
Removed django-2to3.py
Aymeric says, "It was fun to write, but I don't think it's very useful."
| -rwxr-xr-x | django/bin/django-2to3.py | 9 | ||||
| -rw-r--r-- | django/utils/2to3_fixes/__init__.py | 0 | ||||
| -rw-r--r-- | django/utils/2to3_fixes/fix_unicode.py | 36 |
3 files changed, 0 insertions, 45 deletions
diff --git a/django/bin/django-2to3.py b/django/bin/django-2to3.py deleted file mode 100755 index 6d2daec8bf..0000000000 --- a/django/bin/django-2to3.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python - -# This works exactly like 2to3, except that it uses Django's fixers rather -# than 2to3's built-in fixers. - -import sys -from lib2to3.main import main - -sys.exit(main("django.utils.2to3_fixes")) diff --git a/django/utils/2to3_fixes/__init__.py b/django/utils/2to3_fixes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/django/utils/2to3_fixes/__init__.py +++ /dev/null diff --git a/django/utils/2to3_fixes/fix_unicode.py b/django/utils/2to3_fixes/fix_unicode.py deleted file mode 100644 index 613734ca86..0000000000 --- a/django/utils/2to3_fixes/fix_unicode.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Fixer for __unicode__ methods. - -Uses the django.utils.encoding.python_2_unicode_compatible decorator. -""" - -from __future__ import unicode_literals - -from lib2to3 import fixer_base -from lib2to3.fixer_util import find_indentation, Name, syms, touch_import -from lib2to3.pgen2 import token -from lib2to3.pytree import Leaf, Node - - -class FixUnicode(fixer_base.BaseFix): - - BM_compatible = True - PATTERN = """ - classdef< 'class' any+ ':' - suite< any* - funcdef< 'def' unifunc='__unicode__' - parameters< '(' NAME ')' > any+ > - any* > > - """ - - def transform(self, node, results): - unifunc = results["unifunc"] - strfunc = Name("__str__", prefix=unifunc.prefix) - unifunc.replace(strfunc) - - klass = node.clone() - klass.prefix = '\n' + find_indentation(node) - decorator = Node(syms.decorator, [Leaf(token.AT, "@"), Name('python_2_unicode_compatible')]) - decorated = Node(syms.decorated, [decorator, klass], prefix=node.prefix) - node.replace(decorated) - - touch_import('django.utils.encoding', 'python_2_unicode_compatible', decorated) |
