Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhougaofeng
magic_pdf
Commits
d61fddef
Commit
d61fddef
authored
Oct 23, 2024
by
zhougaofeng
Browse files
Update common_parse.py
parent
3b30e749
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
magic_pdf/parse/common_parse.py
magic_pdf/parse/common_parse.py
+4
-3
No files found.
magic_pdf/parse/common_parse.py
View file @
d61fddef
...
...
@@ -11,7 +11,7 @@ import os
import
requests
import
configparser
logger
.
add
(
"
../../
parse.log"
,
rotation
=
"10 MB"
,
level
=
"INFO"
,
format
=
"{time} {level} {message}"
,
encoding
=
'utf-8'
,
enqueue
=
True
)
logger
.
add
(
"parse.log"
,
rotation
=
"10 MB"
,
level
=
"INFO"
,
format
=
"{time} {level} {message}"
,
encoding
=
'utf-8'
,
enqueue
=
True
)
def
parse_args
():
...
...
@@ -46,11 +46,11 @@ def process_file(file_path, pdf_ocr, excel_ocr, output_dir,config_path):
if
res
:
logger
.
info
(
f
"文件处理成功,输出文件路径为: '
{
res
}
'"
)
else
:
logger
.
warning
(
f
"文件处理结果
失败
: '
{
file_path
}
'"
)
logger
.
warning
(
f
"文件处理结果
为空
: '
{
file_path
}
'"
)
except
requests
.
exceptions
.
RequestException
as
req_err
:
logger
.
error
(
f
"请求错误,文件: '
{
file_path
}
',错误信息:
{
req_err
}
"
)
except
Exception
as
err
:
logger
.
error
(
f
"处理文件时发生未知错误: '
{
file_path
}
',错误信息:
{
err
}
"
)
logger
.
error
(
f
"处理文件时发生未知错误: '
{
file_path
}
',错误信息:
{
err
}
,res:
{
res
}
"
)
def
normalize_path
(
input_path
):
"""Normalize file paths to use forward slashes."""
...
...
@@ -94,3 +94,4 @@ def main():
if
__name__
==
"__main__"
:
main
()
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