Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
MaYiding
2026-03-02 08:15:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c6c6e36fd0aeb2b6b158f96d437abd2aa1614d72
c6c6e36f
1 parent
745f5970
Revert "Fix: PDF依赖缺失提示框右侧边框未对齐"
This reverts commit
745f5970
.
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
41 deletions
ReportEngine/utils/dependency_check.py
ReportEngine/utils/dependency_check.py
View file @
c6c6e36
...
...
@@ -5,7 +5,6 @@
import
os
import
sys
import
platform
import
unicodedata
from
pathlib
import
Path
from
loguru
import
logger
from
ctypes
import
util
as
ctypes_util
...
...
@@ -13,48 +12,9 @@ from ctypes import util as ctypes_util
BOX_CONTENT_WIDTH
=
62
def
_display_width
(
text
:
str
)
->
int
:
"""计算字符串在终端中的显示宽度(中文/emoji 等宽字符占 2 列)。"""
width
=
0
chars
=
list
(
text
)
n
=
len
(
chars
)
i
=
0
while
i
<
n
:
ch
=
chars
[
i
]
cp
=
ord
(
ch
)
# 零宽:组合标记 / 格式字符(含 Zero Width Joiner 等)
if
unicodedata
.
category
(
ch
)
in
(
'Mn'
,
'Me'
,
'Cf'
):
i
+=
1
continue
# East Asian Fullwidth / Wide(中文汉字、全角标点等)
if
unicodedata
.
east_asian_width
(
ch
)
in
(
'F'
,
'W'
):
width
+=
2
i
+=
1
continue
# 补充平面 emoji(U+1F000 及以上,如 📄🍎📖🐧🪟)
if
cp
>=
0x1F000
:
width
+=
2
i
+=
1
continue
# 文本符号 + VS16 (U+FE0F) → emoji 呈现,宽 2 列(如 ⚠️)
if
i
+
1
<
n
and
ord
(
chars
[
i
+
1
])
==
0xFE0F
:
width
+=
2
i
+=
2
# 跳过当前字符和 VS16
continue
width
+=
1
i
+=
1
return
width
def
_box_line
(
text
:
str
=
""
)
->
str
:
"""Render a single line inside the 66-char help box."""
padding
=
max
(
0
,
BOX_CONTENT_WIDTH
-
_display_width
(
text
))
return
f
"║ {text}{' ' * padding}║
\n
"
return
f
"║ {text:<{BOX_CONTENT_WIDTH}}║
\n
"
def
_get_platform_specific_instructions
():
...
...
Please
register
or
login
to post a comment