pydatamax 0.1.16__py3-none-any.whl → 0.1.16.post1__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.
@@ -125,12 +125,23 @@ class UnoManager:
125
125
  cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
126
126
  )
127
127
  logger.info(f"⏳ 等待LibreOffice服务启动...")
128
- time.sleep(5) # 给服务一些启动时间
129
-
130
- if self._check_soffice_running():
131
- logger.info("✅ LibreOffice服务启动成功")
132
- else:
133
- raise Exception("LibreOffice服务启动失败")
128
+
129
+ # 智能等待:轮询检查服务状态,给不同性能机器弹性时间
130
+ start_time = time.time()
131
+ check_interval = 1 # 每1秒检查一次
132
+ max_wait_time = 30 # 最大等待30秒
133
+
134
+ while time.time() - start_time < max_wait_time:
135
+ if self._check_soffice_running():
136
+ elapsed = time.time() - start_time
137
+ logger.info(f"✅ LibreOffice服务启动成功 (耗时 {elapsed:.1f}秒)")
138
+ return
139
+
140
+ logger.debug(f"🔄 服务未就绪,继续等待... (已等待 {time.time() - start_time:.1f}秒)")
141
+ time.sleep(check_interval)
142
+
143
+ # 超时仍未启动
144
+ raise Exception(f"LibreOffice服务启动超时 (等待了{max_wait_time}秒)")
134
145
 
135
146
  except Exception as e:
136
147
  logger.error(f"❌ 启动LibreOffice服务失败: {str(e)}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydatamax
3
- Version: 0.1.16
3
+ Version: 0.1.16.post1
4
4
  Summary: A library for parsing and converting various file formats.
5
5
  Home-page: https://github.com/Hi-Dolphin/datamax
6
6
  Author: ccy
@@ -30,9 +30,9 @@ datamax/utils/paddleocr_pdf_operator.py,sha256=SW06dts1SxDnUvyf5zWYpAN_6t9PLtJXU
30
30
  datamax/utils/ppt_extract.py,sha256=jBVGYEsBGPjHqyq7drHTOM8MnFOwqKyHhbkKmEAryAk,6307
31
31
  datamax/utils/qa_generator.py,sha256=pXxdFm_EnWgMuilfmLKgy2c6NDexQZN8nWxT-bYBt74,12548
32
32
  datamax/utils/tokenizer.py,sha256=o78GPmeJ3vs3-SF0b2nMm35XtbrCKbrhDW0gI9gqGl4,880
33
- datamax/utils/uno_handler.py,sha256=gDm42OQQQoCiOP0SB7xZ9TRF6A_XBHNavwG5ycj6kEQ,14807
34
- pydatamax-0.1.16.dist-info/licenses/LICENSE,sha256=RltoeMa9c1956S08ThvZE2yJSPbnem68Y8cmiIfOgco,1088
35
- pydatamax-0.1.16.dist-info/METADATA,sha256=nwHHLzsxwm_Za3aVbLMFfL-3JIZSZclp9KI0XL6rOHE,9795
36
- pydatamax-0.1.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- pydatamax-0.1.16.dist-info/top_level.txt,sha256=N9TrwI3GKnWW07RRXHr0xX5Bm8dIM_sahfAnf9j8J9M,8
38
- pydatamax-0.1.16.dist-info/RECORD,,
33
+ datamax/utils/uno_handler.py,sha256=ehUyk3I8dxMzjK8IzNO5nKcmc-t97ERMUqmSbYPeABc,15435
34
+ pydatamax-0.1.16.post1.dist-info/licenses/LICENSE,sha256=RltoeMa9c1956S08ThvZE2yJSPbnem68Y8cmiIfOgco,1088
35
+ pydatamax-0.1.16.post1.dist-info/METADATA,sha256=6I4bYRn8noQbBVURScRDut0fFksMDiU3wAXSNgpavDg,9801
36
+ pydatamax-0.1.16.post1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ pydatamax-0.1.16.post1.dist-info/top_level.txt,sha256=N9TrwI3GKnWW07RRXHr0xX5Bm8dIM_sahfAnf9j8J9M,8
38
+ pydatamax-0.1.16.post1.dist-info/RECORD,,