ryry-cli 2.44__tar.gz → 2.46__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.44 → ryry_cli-2.46}/PKG-INFO +1 -1
- ryry_cli-2.46/ryry/constant.py +5 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/ryry_webapi.py +46 -1
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/ryry_widget.py +35 -33
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/server_func.py +4 -3
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry_cli.egg-info/PKG-INFO +1 -1
- {ryry_cli-2.44 → ryry_cli-2.46}/setup.py +1 -1
- ryry_cli-2.44/ryry/constant.py +0 -5
- {ryry_cli-2.44 → ryry_cli-2.46}/LICENSE +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/README.md +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/__init__.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/main.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/store.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/task.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/upload.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry/utils.py +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.44 → ryry_cli-2.46}/setup.cfg +0 -0
|
@@ -178,7 +178,7 @@ def TaskCancel(taskUUID):
|
|
|
178
178
|
return False
|
|
179
179
|
return True
|
|
180
180
|
|
|
181
|
-
def
|
|
181
|
+
def _upload(localFilePath, ext):
|
|
182
182
|
with open(localFilePath, "rb") as f:
|
|
183
183
|
files = { 'file':f }
|
|
184
184
|
params = { 'ext':ext }
|
|
@@ -187,6 +187,51 @@ def upload(localFilePath, ext):
|
|
|
187
187
|
raise Exception(f"upload fail!, reason={r2}")
|
|
188
188
|
return r3
|
|
189
189
|
|
|
190
|
+
def upload(localFilePath, ext):
|
|
191
|
+
try:
|
|
192
|
+
return _upload(localFilePath, ext)
|
|
193
|
+
except:
|
|
194
|
+
pass
|
|
195
|
+
from mecord import upload as mecord_upload
|
|
196
|
+
try:
|
|
197
|
+
return mecord_upload.upload(localFilePath, None, "sg")
|
|
198
|
+
except:
|
|
199
|
+
pass
|
|
200
|
+
try:
|
|
201
|
+
return mecord_upload.upload(localFilePath, None, "test")
|
|
202
|
+
except:
|
|
203
|
+
pass
|
|
204
|
+
try:
|
|
205
|
+
import hashlib
|
|
206
|
+
import hmac
|
|
207
|
+
import base64
|
|
208
|
+
timestamp = datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")
|
|
209
|
+
content_type = "application/octet-stream"
|
|
210
|
+
|
|
211
|
+
random_name = ''.join(str(uuid.uuid4()).split('-'))
|
|
212
|
+
object_key = f"temp/{random_name}.{ext}"
|
|
213
|
+
bucket = "p-template-hk"
|
|
214
|
+
resource = f"/{bucket}/{object_key}"
|
|
215
|
+
endpoint = "oss-cn-hongkong.aliyuncs.com"
|
|
216
|
+
string_to_sign = f"PUT\n\n{content_type}\n{timestamp}\n{resource}"
|
|
217
|
+
signature = base64.b64encode(
|
|
218
|
+
hmac.new("sZDIL9uhqTgeQOkAjpbSOFm0259fwZ".encode('utf-8'), string_to_sign.encode('utf-8'), hashlib.sha1).digest()
|
|
219
|
+
).decode('utf-8')
|
|
220
|
+
url = f"https://{bucket}.{endpoint}/{object_key}"
|
|
221
|
+
headers = {
|
|
222
|
+
"Date": timestamp,
|
|
223
|
+
"Authorization": f"OSS LTAI5t6YZQo4MZV6LWwt4Rnj:{signature}",
|
|
224
|
+
"Content-Type": content_type
|
|
225
|
+
}
|
|
226
|
+
with open(localFilePath, "rb") as file:
|
|
227
|
+
file_data = file.read()
|
|
228
|
+
response = requests.put(url, data=file_data, headers=headers)
|
|
229
|
+
if response.status_code == 200:
|
|
230
|
+
return url
|
|
231
|
+
except:
|
|
232
|
+
pass
|
|
233
|
+
raise Exception("all upload target is fail!")
|
|
234
|
+
|
|
190
235
|
def uploadWidget(widget_id, name, whl, ext, version):
|
|
191
236
|
with open(whl, "rb") as f:
|
|
192
237
|
files = { 'file':f }
|
|
@@ -56,25 +56,16 @@ def _remote_package_version(py_package):
|
|
|
56
56
|
|
|
57
57
|
#real time version get
|
|
58
58
|
def _local_package_version(py_package):
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
sl = s.strip().split(" ")
|
|
70
|
-
if len(sl) == 2:
|
|
71
|
-
if py_package.strip() == sl[0].strip():
|
|
72
|
-
local_version = sl[1].strip()
|
|
73
|
-
break
|
|
74
|
-
else:
|
|
75
|
-
continue
|
|
76
|
-
break
|
|
77
|
-
return local_version
|
|
59
|
+
_map = store.widgetMap()
|
|
60
|
+
for it in _map:
|
|
61
|
+
try:
|
|
62
|
+
widget_path = os.path.dirname(_map[it]["path"])
|
|
63
|
+
widget_config = GetWidgetConfig(widget_path)
|
|
64
|
+
if widget_config["name"] == py_package:
|
|
65
|
+
return widget_config["version"]
|
|
66
|
+
except:
|
|
67
|
+
pass
|
|
68
|
+
return ''
|
|
78
69
|
|
|
79
70
|
def _pypi_folder_name(name):
|
|
80
71
|
import re
|
|
@@ -366,23 +357,35 @@ def widgetInstallNotify(widgetName, newver):
|
|
|
366
357
|
})
|
|
367
358
|
|
|
368
359
|
def pipReInstall(name, url):
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
360
|
+
def find_pip_command():
|
|
361
|
+
possible_pips = ['pip', 'pip3']
|
|
362
|
+
for cmd in possible_pips:
|
|
363
|
+
pip_path = shutil.which(cmd)
|
|
364
|
+
if pip_path:
|
|
365
|
+
return cmd
|
|
366
|
+
|
|
367
|
+
for version in range(12, 8, -1):
|
|
368
|
+
cmd = f"pip3.{version}"
|
|
369
|
+
pip_path = shutil.which(cmd)
|
|
370
|
+
if pip_path:
|
|
371
|
+
return cmd
|
|
372
|
+
|
|
373
|
+
raise RuntimeError("No pip command found on the system.")
|
|
374
|
+
pip_cmd = find_pip_command()
|
|
375
|
+
if name:
|
|
376
|
+
subprocess.run(f"{pip_cmd} uninstall {name} -y", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
|
377
|
+
subprocess.run(f"{pip_cmd} install {url} -i https://pypi.python.org/simple/ --extra-index-url https://pypi.python.org/simple/",
|
|
375
378
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
|
376
379
|
|
|
377
380
|
def UpdateWidgetFromPypi():
|
|
378
|
-
|
|
379
|
-
for it in
|
|
381
|
+
_map = store.widgetMap()
|
|
382
|
+
for it in _map:
|
|
380
383
|
is_block = False
|
|
381
|
-
if isinstance(
|
|
382
|
-
is_block =
|
|
383
|
-
path =
|
|
384
|
+
if isinstance(_map[it], (dict)):
|
|
385
|
+
is_block = _map[it]["isBlock"]
|
|
386
|
+
path = _map[it]["path"]
|
|
384
387
|
else:
|
|
385
|
-
path =
|
|
388
|
+
path = _map[it]
|
|
386
389
|
path = os.path.dirname(path)
|
|
387
390
|
if is_block == False and os.path.exists(path):
|
|
388
391
|
data = GetWidgetConfig(path)
|
|
@@ -403,7 +406,7 @@ def UpdateWidgetFromPypi():
|
|
|
403
406
|
print(ex)
|
|
404
407
|
continue
|
|
405
408
|
for widget_id, widget_name, remote_version, package_url in ryry_webapi.getAutoDeployWidget():
|
|
406
|
-
if widget_id not in
|
|
409
|
+
if widget_id not in _map:
|
|
407
410
|
try:
|
|
408
411
|
pipReInstall(widget_name, package_url)
|
|
409
412
|
widgetInstallNotify(widget_name, remote_version)
|
|
@@ -420,7 +423,6 @@ def installWidget(name):
|
|
|
420
423
|
local_version = _local_package_version(name)
|
|
421
424
|
if compare_versions(remote_version, local_version) > 0:
|
|
422
425
|
#update
|
|
423
|
-
print(f"install -> {package_url}")
|
|
424
426
|
pipReInstall(name, package_url)
|
|
425
427
|
widgetInstallNotify(name, remote_version)
|
|
426
428
|
addWidgetToEnv(name)
|
|
@@ -56,8 +56,9 @@ class TaskThread(Thread):
|
|
|
56
56
|
print("")
|
|
57
57
|
self.checking = True
|
|
58
58
|
self.checkCount = 0
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
wait_time_step = 5
|
|
60
|
+
time.sleep(wait_time_step)
|
|
61
|
+
while self.checking and self.checkCount < self.timeout / wait_time_step:
|
|
61
62
|
finish, success, data, progress = ryry_webapi.checkTask(self.checkUUID)
|
|
62
63
|
print_progress_bar(progress, 100, f"Task{self.idx} {self.func}", self.idx+1, self.total)
|
|
63
64
|
if finish:
|
|
@@ -66,7 +67,7 @@ class TaskThread(Thread):
|
|
|
66
67
|
self.call_back(self.idx, data)
|
|
67
68
|
return
|
|
68
69
|
self.checkCount += 1
|
|
69
|
-
time.sleep(
|
|
70
|
+
time.sleep(wait_time_step)
|
|
70
71
|
else:
|
|
71
72
|
print(f"widget {self.func} not found")
|
|
72
73
|
self.call_back(self.idx, None)
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import datetime
|
|
5
5
|
|
|
6
|
-
ryry_version = "2.
|
|
6
|
+
ryry_version = "2.46"
|
|
7
7
|
ryry_build_number = int(ryry_version.replace(".",""))
|
|
8
8
|
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
|
9
9
|
constanspy = os.path.join(cur_dir, "ryry", "constant.py")
|
ryry_cli-2.44/ryry/constant.py
DELETED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|