mdify-cli 3.0.7__py3-none-any.whl → 3.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mdify/__init__.py +1 -1
- mdify/cli.py +13 -3
- {mdify_cli-3.0.7.dist-info → mdify_cli-3.0.8.dist-info}/METADATA +1 -1
- {mdify_cli-3.0.7.dist-info → mdify_cli-3.0.8.dist-info}/RECORD +8 -8
- {mdify_cli-3.0.7.dist-info → mdify_cli-3.0.8.dist-info}/WHEEL +0 -0
- {mdify_cli-3.0.7.dist-info → mdify_cli-3.0.8.dist-info}/entry_points.txt +0 -0
- {mdify_cli-3.0.7.dist-info → mdify_cli-3.0.8.dist-info}/licenses/LICENSE +0 -0
- {mdify_cli-3.0.7.dist-info → mdify_cli-3.0.8.dist-info}/top_level.txt +0 -0
mdify/__init__.py
CHANGED
mdify/cli.py
CHANGED
|
@@ -883,7 +883,7 @@ Examples:
|
|
|
883
883
|
"--timeout",
|
|
884
884
|
type=int,
|
|
885
885
|
default=None,
|
|
886
|
-
help="Conversion timeout in seconds (default:
|
|
886
|
+
help="Conversion timeout in seconds (default: 1200s for local, 3600s for remote with large PDFs, can be set via MDIFY_TIMEOUT env var)",
|
|
887
887
|
)
|
|
888
888
|
|
|
889
889
|
parser.add_argument(
|
|
@@ -1057,6 +1057,10 @@ def main_async_remote(args) -> int:
|
|
|
1057
1057
|
# Resolve timeout value: CLI > env > default 1200
|
|
1058
1058
|
timeout = args.timeout or int(os.environ.get("MDIFY_TIMEOUT", 1200))
|
|
1059
1059
|
|
|
1060
|
+
# For remote operations, extend timeout significantly for large PDF processing
|
|
1061
|
+
# Remote conversions include network latency, file upload/download, and OCR processing
|
|
1062
|
+
remote_conversion_timeout = max(timeout, 3600) # At least 1 hour for remote conversion
|
|
1063
|
+
|
|
1060
1064
|
# Build SSH config from CLI arguments and SSH config files
|
|
1061
1065
|
try:
|
|
1062
1066
|
# Build config with proper precedence (lowest to highest):
|
|
@@ -1178,7 +1182,8 @@ def main_async_remote(args) -> int:
|
|
|
1178
1182
|
return 1
|
|
1179
1183
|
|
|
1180
1184
|
if not args.quiet:
|
|
1181
|
-
print(color.cyan(f"
|
|
1185
|
+
print(color.cyan(f"Found {len(files_to_convert)} file(s) to convert"), file=sys.stderr)
|
|
1186
|
+
print(color.cyan(f"Conversion timeout: {remote_conversion_timeout}s (for large PDFs with OCR)"), file=sys.stderr)
|
|
1182
1187
|
|
|
1183
1188
|
# Import remote container and transfer manager
|
|
1184
1189
|
from mdify.ssh.transfer import FileTransferManager
|
|
@@ -1309,8 +1314,13 @@ def main_async_remote(args) -> int:
|
|
|
1309
1314
|
remote_output_path = f"{work_dir}/{input_file.stem}.md"
|
|
1310
1315
|
|
|
1311
1316
|
# Build conversion command on remote - use -F for multipart form data
|
|
1317
|
+
# Important: use generous timeouts since large PDFs with OCR take time
|
|
1318
|
+
# --connect-timeout: max time to establish connection (60s)
|
|
1319
|
+
# --max-time: max total operation time (extended timeout)
|
|
1312
1320
|
convert_cmd = (
|
|
1313
1321
|
f"curl -X POST "
|
|
1322
|
+
f"--connect-timeout 60 "
|
|
1323
|
+
f"--max-time {remote_conversion_timeout} "
|
|
1314
1324
|
f"-F 'files=@{remote_file_path}' "
|
|
1315
1325
|
f"-F 'to_formats=md' "
|
|
1316
1326
|
f"-F 'do_ocr=true' "
|
|
@@ -1328,7 +1338,7 @@ def main_async_remote(args) -> int:
|
|
|
1328
1338
|
if conversion_attempt > 0 and not args.quiet:
|
|
1329
1339
|
print(f" ↻ Conversion retry {conversion_attempt}...", file=sys.stderr)
|
|
1330
1340
|
|
|
1331
|
-
conversion_output, _, conv_code = await ssh_client.run_command(convert_cmd, timeout=
|
|
1341
|
+
conversion_output, _, conv_code = await ssh_client.run_command(convert_cmd, timeout=remote_conversion_timeout)
|
|
1332
1342
|
|
|
1333
1343
|
if conv_code == 0:
|
|
1334
1344
|
conversion_success = True
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
-
mdify/__init__.py,sha256=
|
|
2
|
+
mdify/__init__.py,sha256=iUfoOWZ_3PErQD0XOXLNy8UyG2lK1eTPJFlW9l5NDdc,90
|
|
3
3
|
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
-
mdify/cli.py,sha256
|
|
4
|
+
mdify/cli.py,sha256=-HYbPCEjRU4iRcurfRpmMCdbHtQS6oNah-zajkzjojA,78732
|
|
5
5
|
mdify/container.py,sha256=BjL5ZR__n1i_WHifXKllTPoqO7IuOUdPDo5esuNg0Iw,8213
|
|
6
6
|
mdify/docling_client.py,sha256=xuQR6sC1v3EPloOSwExoHCqT4uUxE8myYq-Yeby3C2I,7975
|
|
7
7
|
mdify/formatting.py,sha256=lJKhMbDPcaWCdyEa7aKwAm_desaWvkfDc8C3EP7LWp4,790
|
|
@@ -10,9 +10,9 @@ mdify/ssh/client.py,sha256=nO7gAQ6eWxIXFIOplW2F2ya0-1ZEFlLmz3ovi1TEFTg,14997
|
|
|
10
10
|
mdify/ssh/models.py,sha256=jpbDS1yGhd7Xwq2tW7bZv14mTBlR8DCfhT4x-Xf2Wq4,17676
|
|
11
11
|
mdify/ssh/remote_container.py,sha256=KB8rrsp3h5s_2BKPBXhzkOdQFafyPGQhSnFbK20b4yQ,10230
|
|
12
12
|
mdify/ssh/transfer.py,sha256=aQuWa_B81McrgZBBWo_CxnjwoiGHmoxAoqObm19JAk8,10940
|
|
13
|
-
mdify_cli-3.0.
|
|
14
|
-
mdify_cli-3.0.
|
|
15
|
-
mdify_cli-3.0.
|
|
16
|
-
mdify_cli-3.0.
|
|
17
|
-
mdify_cli-3.0.
|
|
18
|
-
mdify_cli-3.0.
|
|
13
|
+
mdify_cli-3.0.8.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
14
|
+
mdify_cli-3.0.8.dist-info/METADATA,sha256=ap0J1JAN1eHngW32_OFd_5jQJrZrm4gcvCEcOMHNGNI,14766
|
|
15
|
+
mdify_cli-3.0.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
16
|
+
mdify_cli-3.0.8.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
17
|
+
mdify_cli-3.0.8.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
18
|
+
mdify_cli-3.0.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|