Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
96968bfa
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
96968bfa
编写于
1月 20, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Port hb-manifest-read to Python
上级
a59ed46f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
40 deletion
+48
-40
test/shaping/hb-diff-filter-failures
test/shaping/hb-diff-filter-failures
+1
-1
test/shaping/hb-manifest-read
test/shaping/hb-manifest-read
+3
-34
test/shaping/hb_test_tools.py
test/shaping/hb_test_tools.py
+44
-5
未找到文件。
test/shaping/hb-diff-filter-failures
浏览文件 @
96968bfa
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
from
hb_test_tools
import
*
from
hb_test_tools
import
*
UtilMains
.
process_multiple_files
(
DiffFilters
.
filter_failures
)
UtilMains
.
filter_multiple_strings_or_stdin
(
Unicode
.
decode
,
"UNICODE_STRING"
)
test/shaping/hb-manifest-read
浏览文件 @
96968bfa
#!/
bin/bash
#!/
usr/bin/python
if
test
$#
=
0
;
then
from
hb_test_tools
import
*
echo
"Usage:
$0
DIR..."
exit
1
fi
strict
=
true
UtilMains
.
process_multiple_args
(
Manifest
.
print_to_stdout
,
mnemonic
=
"DIR"
)
recurse
()
{
if
!
test
-e
"
$1
"
;
then
if
$strict
;
then
echo
"
$0
:
$1
does not exist"
1>&2
exit
1
fi
fi
if
test
-d
"
$1
"
;
then
if
test
-f
"
$1
/MANIFEST"
;
then
cat
"
$1
/MANIFEST"
|
while
read
f
;
do
recurse
"
$1
/
$f
"
done
else
if
$strict
;
then
echo
"
$0
:
$1
/MANIFEST does not exist"
1>&2
exit
1
fi
fi
else
echo
"
$1
"
fi
}
for
root
in
"
$@
"
;
do
root
=
${
root
%/
}
recurse
"
$root
"
;
done
test/shaping/hb_test_tools.py
浏览文件 @
96968bfa
...
@@ -106,23 +106,33 @@ class ShapeFilters:
...
@@ -106,23 +106,33 @@ class ShapeFilters:
class
UtilMains
:
class
UtilMains
:
@
staticmethod
@
staticmethod
def
process_multiple_files
(
callback
):
def
process_multiple_files
(
callback
,
mnemonic
=
"FILE"
):
if
len
(
sys
.
argv
)
==
1
:
if
len
(
sys
.
argv
)
==
1
:
print
"Usage: %s
FILE..."
%
sys
.
argv
[
0
]
print
"Usage: %s
%s..."
%
(
sys
.
argv
[
0
],
mnemonic
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
for
s
in
sys
.
argv
[
1
:]:
for
s
in
sys
.
argv
[
1
:]:
callback
(
FileHelpers
.
open_file_or_stdin
(
s
))
callback
(
FileHelpers
.
open_file_or_stdin
(
s
))
@
staticmethod
@
staticmethod
def
filter_multiple_strings_or_stdin
(
callback
,
string_mnemonic
,
\
def
process_multiple_args
(
callback
,
mnemonic
):
if
len
(
sys
.
argv
)
==
1
:
print
"Usage: %s %s..."
%
(
sys
.
argv
[
0
],
mnemonic
)
sys
.
exit
(
1
)
for
s
in
sys
.
argv
[
1
:]:
callback
(
s
)
@
staticmethod
def
filter_multiple_strings_or_stdin
(
callback
,
mnemonic
,
\
separator
=
" "
,
\
separator
=
" "
,
\
concat_separator
=
False
):
concat_separator
=
False
):
if
len
(
sys
.
argv
)
==
1
or
(
'--stdin'
in
sys
.
argv
and
len
(
sys
.
argv
)
!=
2
):
if
len
(
sys
.
argv
)
==
1
or
(
'--stdin'
in
sys
.
argv
and
len
(
sys
.
argv
)
!=
2
):
print
"Usage:
\n
%s %s...
\n
or:
\n
%s --stdin"
\
print
"Usage:
\n
%s %s...
\n
or:
\n
%s --stdin"
\
%
(
sys
.
argv
[
0
],
string_
mnemonic
,
sys
.
argv
[
0
])
%
(
sys
.
argv
[
0
],
mnemonic
,
sys
.
argv
[
0
])
sys
.
exit
(
1
)
sys
.
exit
(
1
)
if
'--stdin'
in
sys
.
argv
:
if
'--stdin'
in
sys
.
argv
:
...
@@ -189,7 +199,7 @@ class Unicode:
...
@@ -189,7 +199,7 @@ class Unicode:
return
u
' + '
.
join
(
Unicode
.
pretty_name
(
x
)
for
x
in
s
).
encode
(
'utf-8'
)
return
u
' + '
.
join
(
Unicode
.
pretty_name
(
x
)
for
x
in
s
).
encode
(
'utf-8'
)
class
FileHelprs
:
class
FileHelp
e
rs
:
@
staticmethod
@
staticmethod
def
open_file_or_stdin
(
f
):
def
open_file_or_stdin
(
f
):
...
@@ -197,5 +207,34 @@ class FileHelprs:
...
@@ -197,5 +207,34 @@ class FileHelprs:
return
sys
.
stdin
return
sys
.
stdin
return
file
(
f
)
return
file
(
f
)
class
Manifest
:
@
staticmethod
def
print_to_stdout
(
s
,
strict
=
True
):
if
not
os
.
path
.
exists
(
s
):
if
strict
:
print
>>
sys
.
stderr
,
"%s: %s does not exist"
(
sys
.
argv
[
0
],
s
)
sys
.
exit
(
1
)
return
if
os
.
path
.
isdir
(
s
):
if
s
[
-
1
]
!=
'/'
:
s
+=
"/"
try
:
m
=
file
(
s
+
"/MANIFEST"
)
items
=
[
x
.
strip
()
for
x
in
m
.
readlines
()]
for
f
in
items
:
Manifest
.
print_to_stdout
(
s
+
f
)
except
IOError
:
if
strict
:
print
>>
sys
.
stderr
,
"%s: %s does not exist"
(
sys
.
argv
[
0
],
s
+
"/MANIFEST"
)
sys
.
exit
(
1
)
return
else
:
print
s
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
pass
pass
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录