ryry-cli 2.87__tar.gz → 2.88__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 (27) hide show
  1. {ryry-cli-2.87/ryry_cli.egg-info → ryry-cli-2.88}/PKG-INFO +1 -1
  2. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/constant.py +2 -2
  3. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/ryry_server_socket.py +1 -1
  4. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/ryry_webapi.py +3 -2
  5. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/ryry_widget.py +33 -2
  6. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/store.py +7 -7
  7. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/task.py +5 -8
  8. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/utils.py +1 -0
  9. {ryry-cli-2.87 → ryry-cli-2.88/ryry_cli.egg-info}/PKG-INFO +1 -1
  10. {ryry-cli-2.87 → ryry-cli-2.88}/setup.py +1 -1
  11. {ryry-cli-2.87 → ryry-cli-2.88}/LICENSE +0 -0
  12. {ryry-cli-2.87 → ryry-cli-2.88}/README.md +0 -0
  13. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/__init__.py +0 -0
  14. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/main.py +0 -0
  15. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/ryry_service.py +0 -0
  16. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/script_template/__init__.py +0 -0
  17. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/script_template/main.py +0 -0
  18. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/script_template/run.py +0 -0
  19. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/server_func.py +0 -0
  20. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/taskUtils.py +0 -0
  21. {ryry-cli-2.87 → ryry-cli-2.88}/ryry/upload.py +0 -0
  22. {ryry-cli-2.87 → ryry-cli-2.88}/ryry_cli.egg-info/SOURCES.txt +0 -0
  23. {ryry-cli-2.87 → ryry-cli-2.88}/ryry_cli.egg-info/dependency_links.txt +0 -0
  24. {ryry-cli-2.87 → ryry-cli-2.88}/ryry_cli.egg-info/entry_points.txt +0 -0
  25. {ryry-cli-2.87 → ryry-cli-2.88}/ryry_cli.egg-info/requires.txt +0 -0
  26. {ryry-cli-2.87 → ryry-cli-2.88}/ryry_cli.egg-info/top_level.txt +0 -0
  27. {ryry-cli-2.87 → ryry-cli-2.88}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.87
3
+ Version: 2.88
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="2.87"
3
- app_bulld_anchor="Noh_2025-02-07 11:25:13.553987"
2
+ app_version="2.88"
3
+ app_bulld_anchor="Noh_2025-02-08 11:55:33.954153"
4
4
  app_name="ryry-cli"
5
5
  import sys, os
6
6
  if getattr(sys, 'frozen', False):
@@ -157,7 +157,7 @@ class RyryShortConnectThread(Thread):
157
157
 
158
158
  def __init__(self, executor):
159
159
  super().__init__()
160
- self.name = f"RyryShortConnectThread"
160
+ self.name = f"ShortConnect"
161
161
  self.is_running = True
162
162
  self.executor = executor
163
163
  self.start()
@@ -264,7 +264,7 @@ def createTask(widget_name, params):
264
264
  req = {
265
265
  "widget_name": widget_name,
266
266
  "widget_data": json.dumps(params),
267
- "extend": json.dumps(store.extend())
267
+ "extend": store.extend()
268
268
  }
269
269
  r1, r2, r3 = _aigc_post("aigc/task/createTask", req)
270
270
  if r1 != 0:
@@ -300,7 +300,8 @@ def getAutoDeployWidget():
300
300
  widget_name = it["name"]
301
301
  version = it["version"]
302
302
  package = it["package"]
303
- result.append([widget_id, widget_name, version, package])
303
+ is_install = it["is_install"]
304
+ result.append([widget_id, widget_name, version, package, is_install])
304
305
  return result
305
306
 
306
307
  def checkTask(checkUUID):
@@ -285,7 +285,7 @@ def widgetReInstall(name, url, local_path):
285
285
  if pip_path:
286
286
  return cmd
287
287
 
288
- for version in range(12, 8, -1):
288
+ for version in range(12, 11, 10, 9, 8, 13, -1):
289
289
  cmd = f"pip3.{version}"
290
290
  pip_path = shutil.which(cmd)
291
291
  if pip_path:
@@ -322,6 +322,30 @@ def widgetReInstall(name, url, local_path):
322
322
  if os.path.exists(download_file):
323
323
  os.remove(download_file)
324
324
 
325
+ def widgetUninstall(name, url):
326
+ def find_pip_command():
327
+ possible_pips = ['pip3.11', 'pip', 'pip3']
328
+ for cmd in possible_pips:
329
+ pip_path = shutil.which(cmd)
330
+ if pip_path:
331
+ return cmd
332
+
333
+ for version in range(12, 11, 10, 9, 8, 13, -1):
334
+ cmd = f"pip3.{version}"
335
+ pip_path = shutil.which(cmd)
336
+ if pip_path:
337
+ return cmd
338
+
339
+ raise RuntimeError("No pip command found on the system.")
340
+ if url.endswith(".whl"):
341
+ if name:
342
+ pip_cmd = find_pip_command()
343
+ subprocess.run(f"{pip_cmd} uninstall {name} -y", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
344
+ elif url.endswith(".zip"):
345
+ local_path = os.path.join(constant.base_path, "widget", name)
346
+ if os.path.exists(local_path):
347
+ shutil.rmtree(local_path)
348
+
325
349
  def UpdateWidgetFromPypi():
326
350
  _map = store.widgetMap()
327
351
  for it in _map:
@@ -350,16 +374,23 @@ def UpdateWidgetFromPypi():
350
374
  except Exception as ex:
351
375
  print(ex)
352
376
  continue
353
- for widget_id, widget_name, remote_version, package_url in ryry_webapi.getAutoDeployWidget():
377
+ for widget_id, widget_name, remote_version, package_url, is_install in ryry_webapi.getAutoDeployWidget():
354
378
  if widget_id not in _map:
355
379
  try:
356
380
  local_version, local_path = _local_package_info(widget_name)
357
381
  widgetReInstall(widget_name, package_url, local_path)
358
382
  widgetInstallNotify(widget_name, remote_version)
359
383
  addWidgetToEnv(widget_name)
384
+ print(f"auto install ${widget_name}")
360
385
  except Exception as ex:
361
386
  print(ex)
362
387
  continue
388
+ else:
389
+ is_block = _map[widget_id]["isBlock"]
390
+ if is_install == False:
391
+ print(f"auto remove ${widget_name}")
392
+ widgetUninstall(widget_name, package_url)
393
+ store.removeWidget(widget_id)
363
394
 
364
395
  def installWidget(name):
365
396
  widgetid, remote_version, package_url = ryry_webapi.findWidget(name)
@@ -129,15 +129,15 @@ def writeDeviceInfo(data):
129
129
  sp.write(read_data)
130
130
  extend()
131
131
 
132
- GLOBAL_EXT_JSON = {}
132
+ GLOBAL_EXT_JSON = "{}"
133
133
  def extend():
134
- global GLOBAL_EXT_JSON
135
- if len(GLOBAL_EXT_JSON.keys()) < 3:
134
+ global GLOBAL_EXT_JSON
135
+ if len(GLOBAL_EXT_JSON) < 10:
136
136
  sp = Store()
137
137
  read_data = sp.read()
138
138
  if "extend" in read_data:
139
- GLOBAL_EXT_JSON = read_data["extend"]
140
- if len(GLOBAL_EXT_JSON.keys()) < 3:
139
+ GLOBAL_EXT_JSON = json.dumps(read_data["extend"])
140
+ if len(GLOBAL_EXT_JSON) < 10:
141
141
  _genExtend()
142
142
  else:
143
143
  _genExtend()
@@ -157,7 +157,7 @@ def _genExtend():
157
157
  extInfo["device_model"] = platform.machine()
158
158
 
159
159
  try:
160
- extInfo["ip_address"] = requests.get('https://api.ipify.org').text
160
+ extInfo["ip_address"] = requests.get('https://api.ipify.org', timeout=3).text
161
161
  except Exception as e:
162
162
  extInfo["ip_address"] = "unknown"
163
163
 
@@ -169,7 +169,7 @@ def _genExtend():
169
169
  read_data["extend"] = extInfo
170
170
  sp.write(read_data)
171
171
  global GLOBAL_EXT_JSON
172
- GLOBAL_EXT_JSON = extInfo
172
+ GLOBAL_EXT_JSON = json.dumps(extInfo)
173
173
 
174
174
  def is_multithread():
175
175
  return get_multithread() > 1
@@ -6,10 +6,7 @@ import signal
6
6
  import subprocess, multiprocessing
7
7
  from threading import Thread, current_thread, Lock
8
8
 
9
- from ryry import ryry_webapi
10
- from ryry import store
11
- from ryry import taskUtils
12
- from ryry import utils
9
+ from ryry import ryry_webapi,store,taskUtils,utils,constant
13
10
  from pathlib import Path
14
11
 
15
12
  def runTask(it, timeout):
@@ -60,12 +57,12 @@ def cmdWithWidgetName(name):
60
57
  return None
61
58
 
62
59
  def executeLocalPython(taskUUID, cmd, param, timeout=3600):
63
- inputArgs = os.path.join(base_path, f"{taskUUID}.in")
60
+ inputArgs = os.path.join(constant.base_path, f"{taskUUID}.in")
64
61
  if os.path.exists(inputArgs):
65
62
  os.remove(inputArgs)
66
63
  with open(inputArgs, 'w') as f:
67
64
  json.dump(param, f)
68
- outArgs = os.path.join(base_path, f"{taskUUID}.out")
65
+ outArgs = os.path.join(constant.base_path, f"{taskUUID}.out")
69
66
  if os.path.exists(outArgs):
70
67
  os.remove(outArgs)
71
68
 
@@ -103,8 +100,8 @@ def executeLocalPython(taskUUID, cmd, param, timeout=3600):
103
100
  o2 = error.decode(encoding="utf8", errors="ignore")
104
101
  error_msg = f"{o1}\n{o2}"
105
102
  short_error_msg = ""
106
- if len(error_msg) > 610:
107
- short_error_msg = f"{error_msg[0:300]}\n...\n{error_msg[len(error_msg)-300:]}"
103
+ if len(error_msg) > 1010:
104
+ short_error_msg = f"{error_msg[0:500]}\n...\n{error_msg[len(error_msg)-500:]}"
108
105
  else:
109
106
  short_error_msg = error_msg
110
107
  outData["message"] = short_error_msg
@@ -13,6 +13,7 @@ import json
13
13
  from pathlib import Path
14
14
  import socket
15
15
  from PIL import Image
16
+ from ryry import constant
16
17
 
17
18
  def get_mac_from_nettools():
18
19
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.87
3
+ Version: 2.88
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 = "2.87"
6
+ ryry_version = "2.88"
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