Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
33e2c3ec
Kaydet (Commit)
33e2c3ec
authored
Eki 26, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove bogus stdout redirection and use of sys.__stdout__; use
augmented print statement instead.
üst
bce92012
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
32 deletions
+28
-32
pygettext.py
Tools/i18n/pygettext.py
+28
-32
No files found.
Tools/i18n/pygettext.py
Dosyayı görüntüle @
33e2c3ec
...
...
@@ -283,38 +283,34 @@ class TokenEater:
options
=
self
.
__options
timestamp
=
time
.
ctime
(
time
.
time
())
# common header
try
:
sys
.
stdout
=
fp
# The time stamp in the header doesn't have the same format
# as that generated by xgettext...
print
pot_header
%
{
'time'
:
timestamp
,
'version'
:
__version__
}
for
k
,
v
in
self
.
__messages
.
items
():
if
not
options
.
writelocations
:
pass
# location comments are different b/w Solaris and GNU:
elif
options
.
locationstyle
==
options
.
SOLARIS
:
for
filename
,
lineno
in
v
:
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
print
_
(
'# File:
%(filename)
s, line:
%(lineno)
d'
)
%
d
elif
options
.
locationstyle
==
options
.
GNU
:
# fit as many locations on one line, as long as the
# resulting line length doesn't exceeds 'options.width'
locline
=
'#:'
for
filename
,
lineno
in
v
:
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
s
=
_
(
'
%(filename)
s:
%(lineno)
d'
)
%
d
if
len
(
locline
)
+
len
(
s
)
<=
options
.
width
:
locline
=
locline
+
s
else
:
print
locline
locline
=
"#:"
+
s
if
len
(
locline
)
>
2
:
print
locline
# TBD: sorting, normalizing
print
'msgid'
,
normalize
(
k
)
print
'msgstr ""
\n
'
finally
:
sys
.
stdout
=
sys
.
__stdout__
# The time stamp in the header doesn't have the same format
# as that generated by xgettext...
print
>>
fp
,
pot_header
%
{
'time'
:
timestamp
,
'version'
:
__version__
}
for
k
,
v
in
self
.
__messages
.
items
():
if
not
options
.
writelocations
:
pass
# location comments are different b/w Solaris and GNU:
elif
options
.
locationstyle
==
options
.
SOLARIS
:
for
filename
,
lineno
in
v
:
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
print
>>
fp
,
_
(
'# File:
%(filename)
s, line:
%(lineno)
d'
)
%
d
elif
options
.
locationstyle
==
options
.
GNU
:
# fit as many locations on one line, as long as the
# resulting line length doesn't exceeds 'options.width'
locline
=
'#:'
for
filename
,
lineno
in
v
:
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
s
=
_
(
'
%(filename)
s:
%(lineno)
d'
)
%
d
if
len
(
locline
)
+
len
(
s
)
<=
options
.
width
:
locline
=
locline
+
s
else
:
print
>>
fp
,
locline
locline
=
"#:"
+
s
if
len
(
locline
)
>
2
:
print
>>
fp
,
locline
# TBD: sorting, normalizing
print
>>
fp
,
'msgid'
,
normalize
(
k
)
print
>>
fp
,
'msgstr ""
\n
'
def
main
():
...
...
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