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:
...
@@ -283,38 +283,34 @@ class TokenEater:
options
=
self
.
__options
options
=
self
.
__options
timestamp
=
time
.
ctime
(
time
.
time
())
timestamp
=
time
.
ctime
(
time
.
time
())
# common header
# common header
try
:
# The time stamp in the header doesn't have the same format
sys
.
stdout
=
fp
# as that generated by xgettext...
# The time stamp in the header doesn't have the same format
print
>>
fp
,
pot_header
%
{
'time'
:
timestamp
,
'version'
:
__version__
}
# as that generated by xgettext...
for
k
,
v
in
self
.
__messages
.
items
():
print
pot_header
%
{
'time'
:
timestamp
,
'version'
:
__version__
}
if
not
options
.
writelocations
:
for
k
,
v
in
self
.
__messages
.
items
():
pass
if
not
options
.
writelocations
:
# location comments are different b/w Solaris and GNU:
pass
elif
options
.
locationstyle
==
options
.
SOLARIS
:
# location comments are different b/w Solaris and GNU:
for
filename
,
lineno
in
v
:
elif
options
.
locationstyle
==
options
.
SOLARIS
:
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
for
filename
,
lineno
in
v
:
print
>>
fp
,
_
(
'# File:
%(filename)
s, line:
%(lineno)
d'
)
%
d
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
elif
options
.
locationstyle
==
options
.
GNU
:
print
_
(
'# File:
%(filename)
s, line:
%(lineno)
d'
)
%
d
# fit as many locations on one line, as long as the
elif
options
.
locationstyle
==
options
.
GNU
:
# resulting line length doesn't exceeds 'options.width'
# fit as many locations on one line, as long as the
locline
=
'#:'
# resulting line length doesn't exceeds 'options.width'
for
filename
,
lineno
in
v
:
locline
=
'#:'
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
for
filename
,
lineno
in
v
:
s
=
_
(
'
%(filename)
s:
%(lineno)
d'
)
%
d
d
=
{
'filename'
:
filename
,
'lineno'
:
lineno
}
if
len
(
locline
)
+
len
(
s
)
<=
options
.
width
:
s
=
_
(
'
%(filename)
s:
%(lineno)
d'
)
%
d
locline
=
locline
+
s
if
len
(
locline
)
+
len
(
s
)
<=
options
.
width
:
else
:
locline
=
locline
+
s
print
>>
fp
,
locline
else
:
locline
=
"#:"
+
s
print
locline
if
len
(
locline
)
>
2
:
locline
=
"#:"
+
s
print
>>
fp
,
locline
if
len
(
locline
)
>
2
:
# TBD: sorting, normalizing
print
locline
print
>>
fp
,
'msgid'
,
normalize
(
k
)
# TBD: sorting, normalizing
print
>>
fp
,
'msgstr ""
\n
'
print
'msgid'
,
normalize
(
k
)
print
'msgstr ""
\n
'
finally
:
sys
.
stdout
=
sys
.
__stdout__
def
main
():
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