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
9c685051
Kaydet (Commit)
9c685051
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
33e2c3ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
46 deletions
+42
-46
makeunicodedata.py
Tools/unicode/makeunicodedata.py
+42
-46
No files found.
Tools/unicode/makeunicodedata.py
Dosyayı görüntüle @
9c685051
...
@@ -91,56 +91,54 @@ def maketables():
...
@@ -91,56 +91,54 @@ def maketables():
FILE
=
"Modules/unicodedata_db.h"
FILE
=
"Modules/unicodedata_db.h"
sys
.
stdout
=
open
(
FILE
,
"w"
)
fp
=
open
(
FILE
,
"w"
)
print
>>
fp
,
"/* this file was generated by
%
s
%
s */"
%
(
SCRIPT
,
VERSION
)
print
"/* this file was generated by
%
s
%
s */"
%
(
SCRIPT
,
VERSION
)
print
>>
fp
print
print
>>
fp
,
"/* a list of unique database records */"
print
"/* a list of unique database records */"
print
>>
fp
,
\
print
"const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {"
"const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {"
for
item
in
table
:
for
item
in
table
:
print
" {
%
d,
%
d,
%
d,
%
d},"
%
item
print
>>
fp
,
" {
%
d,
%
d,
%
d,
%
d},"
%
item
print
"};"
print
>>
fp
,
"};"
print
print
>>
fp
# FIXME: the following tables should be made static, and
# FIXME: the following tables should be made static, and
# the support code moved into unicodedatabase.c
# the support code moved into unicodedatabase.c
print
"/* string literals */"
print
>>
fp
,
"/* string literals */"
print
"const char *_PyUnicode_CategoryNames[] = {"
print
>>
fp
,
"const char *_PyUnicode_CategoryNames[] = {"
for
name
in
CATEGORY_NAMES
:
for
name
in
CATEGORY_NAMES
:
print
"
\"
%
s
\"
,"
%
name
print
>>
fp
,
"
\"
%
s
\"
,"
%
name
print
" NULL"
print
>>
fp
,
" NULL"
print
"};"
print
>>
fp
,
"};"
print
"const char *_PyUnicode_BidirectionalNames[] = {"
print
>>
fp
,
"const char *_PyUnicode_BidirectionalNames[] = {"
for
name
in
BIDIRECTIONAL_NAMES
:
for
name
in
BIDIRECTIONAL_NAMES
:
print
"
\"
%
s
\"
,"
%
name
print
>>
fp
,
"
\"
%
s
\"
,"
%
name
print
" NULL"
print
>>
fp
,
" NULL"
print
"};"
print
>>
fp
,
"};"
print
"static const char *decomp_data[] = {"
print
>>
fp
,
"static const char *decomp_data[] = {"
for
name
in
decomp_data
:
for
name
in
decomp_data
:
print
"
\"
%
s
\"
,"
%
name
print
>>
fp
,
"
\"
%
s
\"
,"
%
name
print
" NULL"
print
>>
fp
,
" NULL"
print
"};"
print
>>
fp
,
"};"
# split record index table
# split record index table
index1
,
index2
,
shift
=
splitbins
(
index
)
index1
,
index2
,
shift
=
splitbins
(
index
)
print
"/* index tables for the database records */"
print
>>
fp
,
"/* index tables for the database records */"
print
"#define SHIFT"
,
shift
print
>>
fp
,
"#define SHIFT"
,
shift
Array
(
"index1"
,
index1
)
.
dump
(
sys
.
stdout
)
Array
(
"index1"
,
index1
)
.
dump
(
fp
)
Array
(
"index2"
,
index2
)
.
dump
(
sys
.
stdout
)
Array
(
"index2"
,
index2
)
.
dump
(
fp
)
# split decomposition index table
# split decomposition index table
index1
,
index2
,
shift
=
splitbins
(
decomp_index
)
index1
,
index2
,
shift
=
splitbins
(
decomp_index
)
print
"/* index tables for the decomposition data */"
print
>>
fp
,
"/* index tables for the decomposition data */"
print
"#define DECOMP_SHIFT"
,
shift
print
>>
fp
,
"#define DECOMP_SHIFT"
,
shift
Array
(
"decomp_index1"
,
index1
)
.
dump
(
sys
.
stdout
)
Array
(
"decomp_index1"
,
index1
)
.
dump
(
fp
)
Array
(
"decomp_index2"
,
index2
)
.
dump
(
sys
.
stdout
)
Array
(
"decomp_index2"
,
index2
)
.
dump
(
fp
)
sys
.
stdout
=
sys
.
__stdout__
#
#
# 3) unicode type data
# 3) unicode type data
...
@@ -206,26 +204,24 @@ def maketables():
...
@@ -206,26 +204,24 @@ def maketables():
FILE
=
"Objects/unicodetype_db.h"
FILE
=
"Objects/unicodetype_db.h"
sys
.
stdout
=
open
(
FILE
,
"w"
)
fp
=
open
(
FILE
,
"w"
)
print
"/* this file was generated by
%
s
%
s */"
%
(
SCRIPT
,
VERSION
)
print
>>
fp
,
"/* this file was generated by
%
s
%
s */"
%
(
SCRIPT
,
VERSION
)
print
print
>>
fp
print
"/* a list of unique character type descriptors */"
print
>>
fp
,
"/* a list of unique character type descriptors */"
print
"const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {"
print
>>
fp
,
"const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {"
for
item
in
table
:
for
item
in
table
:
print
" {
%
d,
%
d,
%
d,
%
d,
%
d,
%
d},"
%
item
print
>>
fp
,
" {
%
d,
%
d,
%
d,
%
d,
%
d,
%
d},"
%
item
print
"};"
print
>>
fp
,
"};"
print
print
>>
fp
# split decomposition index table
# split decomposition index table
index1
,
index2
,
shift
=
splitbins
(
index
)
index1
,
index2
,
shift
=
splitbins
(
index
)
print
"/* type indexes */"
print
>>
fp
,
"/* type indexes */"
print
"#define SHIFT"
,
shift
print
>>
fp
,
"#define SHIFT"
,
shift
Array
(
"index1"
,
index1
)
.
dump
(
sys
.
stdout
)
Array
(
"index1"
,
index1
)
.
dump
(
fp
)
Array
(
"index2"
,
index2
)
.
dump
(
sys
.
stdout
)
Array
(
"index2"
,
index2
)
.
dump
(
fp
)
sys
.
stdout
=
sys
.
__stdout__
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# the following support code is taken from the unidb utilities
# the following support code is taken from the unidb utilities
...
...
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