Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
68d7dd98
authored
2021-07-26 16:14:15 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add catch error
1 parent
c1ca6fa5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
src/apps/doc/management/commands/folder_ltgt_process.py
src/apps/doc/management/commands/folder_ltgt_process.py
View file @
68d7dd9
...
...
@@ -379,16 +379,20 @@ class Command(BaseCommand, LoggerMixin):
else
:
wb
=
Workbook
()
for
result
in
result_list
:
sheet_name
,
head_fields
=
self
.
sheet_content
[
result
[
self
.
CLASSIFY_KEY
]]
row
=
[]
for
field
in
head_fields
:
row
.
append
(
result
[
self
.
RESULT_KEY
]
.
get
(
field
))
if
sheet_name
in
wb
.
sheetnames
:
ws
=
wb
.
get_sheet_by_name
(
sheet_name
)
else
:
ws
=
wb
.
create_sheet
(
sheet_name
)
ws
.
append
(
head_fields
)
ws
.
append
(
row
)
try
:
sheet_name
,
head_fields
=
self
.
sheet_content
[
result
[
self
.
CLASSIFY_KEY
]]
row
=
[]
for
field
in
head_fields
:
row
.
append
(
result
[
self
.
RESULT_KEY
]
.
get
(
field
))
if
sheet_name
in
wb
.
sheetnames
:
ws
=
wb
.
get_sheet_by_name
(
sheet_name
)
else
:
ws
=
wb
.
create_sheet
(
sheet_name
)
ws
.
append
(
head_fields
)
ws
.
append
(
row
)
except
Exception
as
e
:
self
.
folder_log
.
info
(
'{0} [daily wb failed] [result={1}] [error={2}]'
.
format
(
self
.
log_base
,
result
,
traceback
.
format_exc
()))
wb
.
save
(
wb_path
)
def
folder_process
(
self
,
input_dir
,
classify
,
result_queue
):
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment