ryry-cli 4.17__tar.gz → 4.19__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.17/ryry_cli.egg-info → ryry_cli-4.19}/PKG-INFO +1 -1
  2. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/constant.py +2 -2
  3. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/daemon_base.py +10 -0
  4. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/main.py +1 -1
  5. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/ryry_webapi.py +13 -0
  6. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/shared_memory.py +0 -1
  7. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/store.py +1 -1
  8. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/upload.py +1 -2
  9. {ryry_cli-4.17 → ryry_cli-4.19/ryry_cli.egg-info}/PKG-INFO +1 -1
  10. {ryry_cli-4.17 → ryry_cli-4.19}/setup.py +1 -1
  11. {ryry_cli-4.17 → ryry_cli-4.19}/LICENSE +0 -0
  12. {ryry_cli-4.17 → ryry_cli-4.19}/README.md +0 -0
  13. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/__init__.py +0 -0
  14. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/daemon_manager.py +0 -0
  15. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/ryry_server_socket.py +0 -0
  16. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/ryry_service.py +0 -0
  17. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/ryry_widget.py +0 -0
  18. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/script_template/__init__.py +0 -0
  19. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/script_template/daemon.py +0 -0
  20. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/script_template/main.py +0 -0
  21. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/script_template/run.py +0 -0
  22. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/server_func.py +0 -0
  23. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/task.py +0 -0
  24. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/taskUtils.py +0 -0
  25. {ryry_cli-4.17 → ryry_cli-4.19}/ryry/utils.py +0 -0
  26. {ryry_cli-4.17 → ryry_cli-4.19}/ryry_cli.egg-info/SOURCES.txt +0 -0
  27. {ryry_cli-4.17 → ryry_cli-4.19}/ryry_cli.egg-info/dependency_links.txt +0 -0
  28. {ryry_cli-4.17 → ryry_cli-4.19}/ryry_cli.egg-info/entry_points.txt +0 -0
  29. {ryry_cli-4.17 → ryry_cli-4.19}/ryry_cli.egg-info/requires.txt +0 -0
  30. {ryry_cli-4.17 → ryry_cli-4.19}/ryry_cli.egg-info/top_level.txt +0 -0
  31. {ryry_cli-4.17 → ryry_cli-4.19}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 4.17
3
+ Version: 4.19
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.17"
3
- app_bulld_anchor="Noh_2025-07-23 11:00:45.076043"
2
+ app_version="4.19"
3
+ app_bulld_anchor="Noh_2025-07-23 18:25:48.042147"
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)
@@ -329,7 +329,7 @@ def widget():
329
329
  if is_block:
330
330
  end_args = " [X]"
331
331
  if daemon_enabled:
332
- end_args += " [支持后台运行]"
332
+ end_args += " [D]"
333
333
  ss = f"{it}{end_args}"
334
334
  if showStatus in ["disable", "enable"]:
335
335
  if is_block and showStatus == "disable":
@@ -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.17":
158
+ elif read_data["extend"].get("app", "") == "ryry-cli 4.19":
159
159
  _genExtend()
160
160
  else:
161
161
  _genExtend()
@@ -106,7 +106,7 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=N
106
106
  if ftp_config:
107
107
  return ftpUpload(src, file_name, ftp_config, upload_path)
108
108
 
109
- if "mnt/NAS/mcn" in upload_path:
109
+ if "mnt/NAS/mcn" in upload_path or "aigc_output/" in targetDomain:
110
110
  ftp_config = getFtpConfig("183.6.90.205")
111
111
  return ftpUpload(src, file_name, ftp_config, upload_path)
112
112
  elif (targetDomain == None or len(targetDomain) <= 0) and (uploadPath and len(uploadPath) > 0):
@@ -114,7 +114,6 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=N
114
114
  ftp_config = getFtpConfig("183.6.90.205")
115
115
  return ftpUpload(src, file_name, ftp_config, upload_path)
116
116
 
117
-
118
117
  from ryry import ryry_webapi
119
118
  return ryry_webapi.upload(src, ext, keepItAlways)
120
119
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 4.17
3
+ Version: 4.19
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.17"
6
+ ryry_version = "4.19"
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