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
3c3eda2b
Kaydet (Commit)
3c3eda2b
authored
Şub 05, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
stuff by jack to create a set of Estr resources
üst
81920f1b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
errors.txt
Mac/scripts/errors.txt
+0
-0
mkestrres.py
Mac/scripts/mkestrres.py
+62
-0
No files found.
Mac/scripts/errors.txt
0 → 100644
Dosyayı görüntüle @
3c3eda2b
This diff is collapsed.
Click to expand it.
Mac/scripts/mkestrres.py
0 → 100644
Dosyayı görüntüle @
3c3eda2b
#
# Create 'Estr' resource from error dictionary
from
Res
import
*
import
Res
from
Resources
import
*
import
MacOS
import
string
READ
=
1
WRITE
=
2
smAllScripts
=
-
3
def
Pstring
(
str
):
if
len
(
str
)
>
255
:
raise
ValueError
,
'String too large'
return
chr
(
len
(
str
))
+
str
def
writeestr
(
dst
,
edict
):
"""Create Estr resource file given a dictionary of errors."""
FSpCreateResFile
(
dst
,
'RSED'
,
'rsrc'
,
smAllScripts
)
output
=
FSpOpenResFile
(
dst
,
WRITE
)
UseResFile
(
output
)
for
num
in
edict
.
keys
():
res
=
Resource
(
Pstring
(
edict
[
num
]))
res
.
AddResource
(
'Estr'
,
num
,
''
)
res
.
WriteResource
()
CloseResFile
(
output
)
def
parsefile
(
src
):
fp
=
open
(
src
)
lines
=
[]
while
1
:
x
=
fp
.
readline
()
if
not
x
:
break
x
=
x
[:
-
1
]
words
=
string
.
split
(
x
)
if
x
[
0
]
in
(
' '
,
'
\t
'
):
# continuation line
x
=
string
.
join
(
words
)
lines
[
-
1
]
=
lines
[
-
1
]
+
' '
+
x
else
:
x
=
string
.
join
(
words
)
lines
.
append
(
x
)
dict
=
{}
for
line
in
lines
:
words
=
string
.
split
(
line
)
index
=
eval
(
words
[
0
])
if
dict
.
has_key
(
index
):
print
'** Duplicate key:'
,
index
x
=
string
.
join
(
words
[
2
:])
if
not
x
:
x
=
words
[
1
]
dict
[
index
]
=
x
return
dict
if
__name__
==
'__main__'
:
dict
=
parsefile
(
'errors.txt'
)
writeestr
(
'errors.rsrc'
,
dict
)
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