Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9c685051
Commit
9c685051
authored
Oct 26, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove bogus stdout redirection and use of sys.__stdout__; use
augmented print statement instead.
parent
33e2c3ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
46 deletions
+42
-46
Tools/unicode/makeunicodedata.py
Tools/unicode/makeunicodedata.py
+42
-46
No files found.
Tools/unicode/makeunicodedata.py
View file @
9c685051
...
...
@@ -91,56 +91,54 @@ def maketables():
FILE
=
"Modules/unicodedata_db.h"
sys
.
stdout
=
open
(
FILE
,
"w"
)
print
"/* this file was generated by %s %s */"
%
(
SCRIPT
,
VERSION
)
print
print
"/* a list of unique database records */"
print
"const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {"
fp
=
open
(
FILE
,
"w"
)
print
>>
fp
,
"/* this file was generated by %s %s */"
%
(
SCRIPT
,
VERSION
)
print
>>
fp
print
>>
fp
,
"/* a list of unique database records */"
print
>>
fp
,
\
"const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {"
for
item
in
table
:
print
" {%d, %d, %d, %d},"
%
item
print
"};"
print
print
>>
fp
,
" {%d, %d, %d, %d},"
%
item
print
>>
fp
,
"};"
print
>>
fp
# FIXME: the following tables should be made static, and
# the support code moved into unicodedatabase.c
print
"/* string literals */"
print
"const char *_PyUnicode_CategoryNames[] = {"
print
>>
fp
,
"/* string literals */"
print
>>
fp
,
"const char *_PyUnicode_CategoryNames[] = {"
for
name
in
CATEGORY_NAMES
:
print
"
\
"
%s
\
"
,"
%
name
print
" NULL"
print
"};"
print
>>
fp
,
"
\
"
%s
\
"
,"
%
name
print
>>
fp
,
" NULL"
print
>>
fp
,
"};"
print
"const char *_PyUnicode_BidirectionalNames[] = {"
print
>>
fp
,
"const char *_PyUnicode_BidirectionalNames[] = {"
for
name
in
BIDIRECTIONAL_NAMES
:
print
"
\
"
%s
\
"
,"
%
name
print
" NULL"
print
"};"
print
>>
fp
,
"
\
"
%s
\
"
,"
%
name
print
>>
fp
,
" NULL"
print
>>
fp
,
"};"
print
"static const char *decomp_data[] = {"
print
>>
fp
,
"static const char *decomp_data[] = {"
for
name
in
decomp_data
:
print
"
\
"
%s
\
"
,"
%
name
print
" NULL"
print
"};"
print
>>
fp
,
"
\
"
%s
\
"
,"
%
name
print
>>
fp
,
" NULL"
print
>>
fp
,
"};"
# split record index table
index1
,
index2
,
shift
=
splitbins
(
index
)
print
"/* index tables for the database records */"
print
"#define SHIFT"
,
shift
Array
(
"index1"
,
index1
).
dump
(
sys
.
stdout
)
Array
(
"index2"
,
index2
).
dump
(
sys
.
stdout
)
print
>>
fp
,
"/* index tables for the database records */"
print
>>
fp
,
"#define SHIFT"
,
shift
Array
(
"index1"
,
index1
).
dump
(
fp
)
Array
(
"index2"
,
index2
).
dump
(
fp
)
# split decomposition index table
index1
,
index2
,
shift
=
splitbins
(
decomp_index
)
print
"/* index tables for the decomposition data */"
print
"#define DECOMP_SHIFT"
,
shift
Array
(
"decomp_index1"
,
index1
).
dump
(
sys
.
stdout
)
Array
(
"decomp_index2"
,
index2
).
dump
(
sys
.
stdout
)
sys
.
stdout
=
sys
.
__stdout__
print
>>
fp
,
"/* index tables for the decomposition data */"
print
>>
fp
,
"#define DECOMP_SHIFT"
,
shift
Array
(
"decomp_index1"
,
index1
).
dump
(
fp
)
Array
(
"decomp_index2"
,
index2
).
dump
(
fp
)
#
# 3) unicode type data
...
...
@@ -206,26 +204,24 @@ def maketables():
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
print
"/* a list of unique character type descriptors */"
print
"const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {"
print
>>
fp
,
"/* this file was generated by %s %s */"
%
(
SCRIPT
,
VERSION
)
print
>>
fp
print
>>
fp
,
"/* a list of unique character type descriptors */"
print
>>
fp
,
"const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {"
for
item
in
table
:
print
" {%d, %d, %d, %d, %d, %d},"
%
item
print
"};"
print
print
>>
fp
,
" {%d, %d, %d, %d, %d, %d},"
%
item
print
>>
fp
,
"};"
print
>>
fp
# split decomposition index table
index1
,
index2
,
shift
=
splitbins
(
index
)
print
"/* type indexes */"
print
"#define SHIFT"
,
shift
Array
(
"index1"
,
index1
).
dump
(
sys
.
stdout
)
Array
(
"index2"
,
index2
).
dump
(
sys
.
stdout
)
sys
.
stdout
=
sys
.
__stdout__
print
>>
fp
,
"/* type indexes */"
print
>>
fp
,
"#define SHIFT"
,
shift
Array
(
"index1"
,
index1
).
dump
(
fp
)
Array
(
"index2"
,
index2
).
dump
(
fp
)
# --------------------------------------------------------------------
# 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