Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
607af78b
Kaydet (Commit)
607af78b
authored
Şub 06, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed django-2to3.py
Aymeric says, "It was fun to write, but I don't think it's very useful."
üst
bbe28496
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
45 deletions
+0
-45
django-2to3.py
django/bin/django-2to3.py
+0
-9
__init__.py
django/utils/2to3_fixes/__init__.py
+0
-0
fix_unicode.py
django/utils/2to3_fixes/fix_unicode.py
+0
-36
No files found.
django/bin/django-2to3.py
deleted
100755 → 0
Dosyayı görüntüle @
bbe28496
#!/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"
))
django/utils/2to3_fixes/__init__.py
deleted
100644 → 0
Dosyayı görüntüle @
bbe28496
django/utils/2to3_fixes/fix_unicode.py
deleted
100644 → 0
Dosyayı görüntüle @
bbe28496
"""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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment