ryry-cli 4.18__tar.gz → 4.20__tar.gz

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.
Files changed (31) hide show
  1. {ryry_cli-4.18/ryry_cli.egg-info → ryry_cli-4.20}/PKG-INFO +1 -1
  2. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/constant.py +2 -2
  3. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/daemon_base.py +10 -0
  4. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_webapi.py +13 -0
  5. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/shared_memory.py +0 -1
  6. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/store.py +1 -1
  7. {ryry_cli-4.18 → ryry_cli-4.20/ryry_cli.egg-info}/PKG-INFO +1 -1
  8. {ryry_cli-4.18 → ryry_cli-4.20}/setup.py +1 -1
  9. {ryry_cli-4.18 → ryry_cli-4.20}/LICENSE +0 -0
  10. {ryry_cli-4.18 → ryry_cli-4.20}/README.md +0 -0
  11. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/__init__.py +0 -0
  12. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/daemon_manager.py +0 -0
  13. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/main.py +0 -0
  14. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_server_socket.py +0 -0
  15. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_service.py +0 -0
  16. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_widget.py +0 -0
  17. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/__init__.py +0 -0
  18. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/daemon.py +0 -0
  19. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/main.py +0 -0
  20. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/run.py +0 -0
  21. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/server_func.py +0 -0
  22. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/task.py +0 -0
  23. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/taskUtils.py +0 -0
  24. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/upload.py +0 -0
  25. {ryry_cli-4.18 → ryry_cli-4.20}/ryry/utils.py +0 -0
  26. {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/SOURCES.txt +0 -0
  27. {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/dependency_links.txt +0 -0
  28. {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/entry_points.txt +0 -0
  29. {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/requires.txt +0 -0
  30. {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/top_level.txt +0 -0
  31. {ryry_cli-4.18 → ryry_cli-4.20}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 4.18
3
+ Version: 4.20
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -1,6 +1,6 @@
1
1
  #!!!!! do not change this file !!!!!
2
- app_version="4.18"
3
- app_bulld_anchor="Noh_2025-07-23 15:44:54.775825"
2
+ app_version="4.20"
3
+ app_bulld_anchor="Noh_2025-07-23 22:54:54.495460"
4
4
  app_name="ryry-cli"
5
5
  import sys, os
6
6
  if getattr(sys, 'frozen', False):
@@ -5,6 +5,7 @@ import time
5
5
  import signal
6
6
  import threading
7
7
  from typing import Optional, Dict, Any
8
+ from ryry import ryry_webapi
8
9
 
9
10
  class SimpleDaemonBase:
10
11
  """
@@ -223,6 +224,9 @@ class SimpleDaemonBase:
223
224
 
224
225
  # 主循环
225
226
  self.running = True
227
+ last_status_report_time = 0 # 上次状态上报时间
228
+ status_report_interval = 60 # 状态上报间隔(秒)
229
+
226
230
  while self.running:
227
231
  try:
228
232
  # 处理命令
@@ -231,6 +235,12 @@ class SimpleDaemonBase:
231
235
  # 执行循环函数
232
236
  self.loop_function()
233
237
 
238
+ # 每分钟报告一次状态
239
+ current_time = time.time()
240
+ if current_time - last_status_report_time >= status_report_interval:
241
+ ryry_webapi.widgetStatusReport(self.widget_id, self.health_check())
242
+ last_status_report_time = current_time
243
+
234
244
  time.sleep(1)
235
245
  except KeyboardInterrupt:
236
246
  print(f"【{self.widget_name}】收到KeyboardInterrupt", file=sys.stderr)
@@ -1,5 +1,8 @@
1
1
  import json, os, datetime
2
2
  import uuid, requests, calendar, time
3
+ import urllib3
4
+ urllib3.disable_warnings()
5
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
3
6
  from requests.adapters import HTTPAdapter
4
7
  from urllib3.util.retry import Retry
5
8
  from urllib.parse import urlparse, urlunparse
@@ -332,6 +335,16 @@ def upload(localFilePath, ext, keepItAlways=False):
332
335
  pass
333
336
  raise Exception("all upload target is fail!")
334
337
 
338
+ def widgetStatusReport(widget_id, data):
339
+ r1, r2, r3 = _aigc_post("aigc/task/widgetStatus", {
340
+ "data" : data,
341
+ "widget_id" : widget_id,
342
+ "extend": store.extend()
343
+ })
344
+ if r1 != 0:
345
+ raise Exception(f"report widget status fail!, reason={r2}")
346
+ return r3
347
+
335
348
  def uploadWidget(widget_id, name, whl, ext, version):
336
349
  with open(whl, "rb") as f:
337
350
  files = { 'file':f }
@@ -445,7 +445,6 @@ class SharedMemoryService:
445
445
  json.dump(data, f, indent=2, ensure_ascii=False)
446
446
  f.flush()
447
447
  os.fsync(f.fileno()) # 确保数据写入磁盘
448
-
449
448
  # 原子性地替换文件
450
449
  os.replace(temp_file, self.data_file)
451
450
  except Exception as e:
@@ -155,7 +155,7 @@ def extend():
155
155
  _genExtend()
156
156
  elif read_data["extend"].get("device_id", "") != read_data.get("deviceInfo", {}).get("device_id", ""):
157
157
  _genExtend()
158
- elif read_data["extend"].get("app", "") == "ryry-cli 4.18":
158
+ elif read_data["extend"].get("app", "") == "ryry-cli 4.20":
159
159
  _genExtend()
160
160
  else:
161
161
  _genExtend()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 4.18
3
+ Version: 4.20
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -3,7 +3,7 @@ import os
3
3
  import subprocess
4
4
  import datetime
5
5
 
6
- ryry_version = "4.18"
6
+ ryry_version = "4.20"
7
7
  cur_dir = os.path.dirname(os.path.abspath(__file__))
8
8
  constanspy = os.path.join(cur_dir, "ryry", "constant.py")
9
9
  try:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes