ryry-cli 2.86__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.
- {ryry-cli-2.86/ryry_cli.egg-info → ryry-cli-2.88}/PKG-INFO +1 -1
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/constant.py +2 -2
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/ryry_server_socket.py +1 -1
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/ryry_webapi.py +6 -3
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/ryry_widget.py +33 -2
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/store.py +7 -7
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/task.py +5 -8
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/utils.py +1 -0
- {ryry-cli-2.86 → ryry-cli-2.88/ryry_cli.egg-info}/PKG-INFO +1 -1
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry_cli.egg-info/requires.txt +0 -1
- {ryry-cli-2.86 → ryry-cli-2.88}/setup.py +1 -2
- {ryry-cli-2.86 → ryry-cli-2.88}/LICENSE +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/README.md +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/__init__.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/main.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/ryry_service.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/script_template/__init__.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/script_template/main.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/script_template/run.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/server_func.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/taskUtils.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry/upload.py +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry-cli-2.86 → ryry-cli-2.88}/setup.cfg +0 -0
|
@@ -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":
|
|
267
|
+
"extend": store.extend()
|
|
268
268
|
}
|
|
269
269
|
r1, r2, r3 = _aigc_post("aigc/task/createTask", req)
|
|
270
270
|
if r1 != 0:
|
|
@@ -288,7 +288,9 @@ def findWidget(name):
|
|
|
288
288
|
return "", "", ""
|
|
289
289
|
|
|
290
290
|
def getAutoDeployWidget():
|
|
291
|
-
req = {
|
|
291
|
+
req = {
|
|
292
|
+
"extend": store.extend()
|
|
293
|
+
}
|
|
292
294
|
r1, r2, r3 = _aigc_post("aigc/task/getAutoDeployWidget", req)
|
|
293
295
|
result = []
|
|
294
296
|
if r1 != 0:
|
|
@@ -298,7 +300,8 @@ def getAutoDeployWidget():
|
|
|
298
300
|
widget_name = it["name"]
|
|
299
301
|
version = it["version"]
|
|
300
302
|
package = it["package"]
|
|
301
|
-
|
|
303
|
+
is_install = it["is_install"]
|
|
304
|
+
result.append([widget_id, widget_name, version, package, is_install])
|
|
302
305
|
return result
|
|
303
306
|
|
|
304
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
|
|
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
|
|
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) >
|
|
107
|
-
short_error_msg = f"{error_msg[0:
|
|
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
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import datetime
|
|
5
5
|
|
|
6
|
-
ryry_version = "2.
|
|
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:
|
|
@@ -67,7 +67,6 @@ setuptools.setup(
|
|
|
67
67
|
'requests_toolbelt',
|
|
68
68
|
'matplotlib',
|
|
69
69
|
'fake_useragent',
|
|
70
|
-
'piexif',
|
|
71
70
|
'gputil',
|
|
72
71
|
'urlparser',
|
|
73
72
|
'urllib3',
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|