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
8459eac0
Kaydet (Commit)
8459eac0
authored
Şub 27, 2013
tarafından
Ramiro Morales
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move management helper function to new utils module.
This allows us to iremove an inter-command import.
üst
dfa93249
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
25 deletions
+26
-25
makemessages.py
django/core/management/commands/makemessages.py
+1
-24
templates.py
django/core/management/templates.py
+1
-1
utils.py
django/core/management/utils.py
+24
-0
No files found.
django/core/management/commands/makemessages.py
Dosyayı görüntüle @
8459eac0
...
...
@@ -9,6 +9,7 @@ from subprocess import PIPE, Popen
import
django
from
django.core.management.base
import
CommandError
,
NoArgsCommand
from
django.core.management.utils
import
handle_extensions
from
django.utils.functional
import
total_ordering
from
django.utils.text
import
get_text_list
from
django.utils.jslex
import
prepare_js_for_gettext
...
...
@@ -130,30 +131,6 @@ def write_pot_file(potfile, msgs):
with
open
(
potfile
,
'a'
)
as
fp
:
fp
.
write
(
msgs
)
def
handle_extensions
(
extensions
=
(
'html'
,),
ignored
=
(
'py'
,)):
"""
Organizes multiple extensions that are separated with commas or passed by
using --extension/-e multiple times. Note that the .py extension is ignored
here because of the way non-*.py files are handled in make_messages() (they
are copied to file.ext.py files to trick xgettext to parse them as Python
files).
For example: running 'django-admin makemessages -e js,txt -e xhtml -a'
would result in an extension list: ['.js', '.txt', '.xhtml']
>>> handle_extensions(['.html', 'html,js,py,py,py,.py', 'py,.py'])
set(['.html', '.js'])
>>> handle_extensions(['.html, txt,.tpl'])
set(['.html', '.tpl', '.txt'])
"""
ext_list
=
[]
for
ext
in
extensions
:
ext_list
.
extend
(
ext
.
replace
(
' '
,
''
)
.
split
(
','
))
for
i
,
ext
in
enumerate
(
ext_list
):
if
not
ext
.
startswith
(
'.'
):
ext_list
[
i
]
=
'.
%
s'
%
ext_list
[
i
]
return
set
([
x
for
x
in
ext_list
if
x
.
strip
(
'.'
)
not
in
ignored
])
class
Command
(
NoArgsCommand
):
option_list
=
NoArgsCommand
.
option_list
+
(
...
...
django/core/management/templates.py
Dosyayı görüntüle @
8459eac0
...
...
@@ -21,7 +21,7 @@ from django.template import Template, Context
from
django.utils
import
archive
from
django.utils._os
import
rmtree_errorhandler
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.management.
commands.makemessage
s
import
handle_extensions
from
django.core.management.
util
s
import
handle_extensions
_drive_re
=
re
.
compile
(
'^([a-z]):'
,
re
.
I
)
...
...
django/core/management/utils.py
Dosyayı görüntüle @
8459eac0
...
...
@@ -12,3 +12,27 @@ def popen_wrapper(args):
close_fds
=
os
.
name
!=
'nt'
,
universal_newlines
=
True
)
output
,
errors
=
p
.
communicate
()
return
output
,
errors
,
p
.
returncode
def
handle_extensions
(
extensions
=
(
'html'
,),
ignored
=
(
'py'
,)):
"""
Organizes multiple extensions that are separated with commas or passed by
using --extension/-e multiple times. Note that the .py extension is ignored
here because of the way non-*.py files are handled in make_messages() (they
are copied to file.ext.py files to trick xgettext to parse them as Python
files).
For example: running 'django-admin makemessages -e js,txt -e xhtml -a'
would result in an extension list: ['.js', '.txt', '.xhtml']
>>> handle_extensions(['.html', 'html,js,py,py,py,.py', 'py,.py'])
set(['.html', '.js'])
>>> handle_extensions(['.html, txt,.tpl'])
set(['.html', '.tpl', '.txt'])
"""
ext_list
=
[]
for
ext
in
extensions
:
ext_list
.
extend
(
ext
.
replace
(
' '
,
''
)
.
split
(
','
))
for
i
,
ext
in
enumerate
(
ext_list
):
if
not
ext
.
startswith
(
'.'
):
ext_list
[
i
]
=
'.
%
s'
%
ext_list
[
i
]
return
set
([
x
for
x
in
ext_list
if
x
.
strip
(
'.'
)
not
in
ignored
])
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