Fix linting
This commit is contained in:
parent
6f999aa5e5
commit
35d6e2d322
1 changed files with 5 additions and 2 deletions
|
|
@ -1155,8 +1155,9 @@ def create_app(args):
|
||||||
converter = DocumentConverter()
|
converter = DocumentConverter()
|
||||||
result = converter.convert(file_path)
|
result = converter.convert(file_path)
|
||||||
return result.document.export_to_markdown()
|
return result.document.export_to_markdown()
|
||||||
|
|
||||||
return await asyncio.to_thread(sync_convert)
|
return await asyncio.to_thread(sync_convert)
|
||||||
|
|
||||||
content = await convert_doc()
|
content = await convert_doc()
|
||||||
|
|
||||||
case _:
|
case _:
|
||||||
|
|
@ -1449,13 +1450,15 @@ def create_app(args):
|
||||||
f.write(await file.read())
|
f.write(await file.read())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
async def convert_doc():
|
async def convert_doc():
|
||||||
def sync_convert():
|
def sync_convert():
|
||||||
converter = DocumentConverter()
|
converter = DocumentConverter()
|
||||||
result = converter.convert(str(temp_path))
|
result = converter.convert(str(temp_path))
|
||||||
return result.document.export_to_markdown()
|
return result.document.export_to_markdown()
|
||||||
|
|
||||||
return await asyncio.to_thread(sync_convert)
|
return await asyncio.to_thread(sync_convert)
|
||||||
|
|
||||||
content = await convert_doc()
|
content = await convert_doc()
|
||||||
finally:
|
finally:
|
||||||
# Clean up the temporary file
|
# Clean up the temporary file
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue