ryry-cli 5.2__tar.gz → 5.4__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-5.2/ryry_cli.egg-info → ryry_cli-5.4}/PKG-INFO +1 -1
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/constant.py +2 -2
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/server_func.py +12 -3
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/store.py +1 -1
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/upload.py +14 -25
- {ryry_cli-5.2 → ryry_cli-5.4/ryry_cli.egg-info}/PKG-INFO +1 -1
- {ryry_cli-5.2 → ryry_cli-5.4}/setup.py +1 -1
- {ryry_cli-5.2 → ryry_cli-5.4}/LICENSE +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/README.md +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/__init__.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/daemon_base.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/daemon_manager.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/main.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/proxy_manager.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/ryry_service.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/ryry_webapi.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/ryry_widget.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/script_template/daemon.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/script_template/main.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/script_template/run.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/shared_memory.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/task.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/taskUtils.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry/utils.py +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-5.2 → ryry_cli-5.4}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import time, urllib3, sys, os, uuid, json
|
|
2
2
|
from threading import Thread, Lock
|
|
3
3
|
|
|
4
|
-
from ryry import ryry_webapi, upload, taskUtils, task, constant
|
|
4
|
+
from ryry import ryry_webapi, upload, taskUtils, task, constant, ryry_service
|
|
5
5
|
|
|
6
6
|
lock = Lock()
|
|
7
7
|
def print_progress_bar(iteration, total, name, idx, total_bars):
|
|
@@ -43,8 +43,17 @@ class TaskThread(Thread):
|
|
|
43
43
|
self.checkCount = 0
|
|
44
44
|
wait_time_step = 5
|
|
45
45
|
cmd = task.cmdWithWidgetName(self.func)
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
|
|
47
|
+
if cmd:
|
|
48
|
+
if not ryry_service.ryryService().is_running():
|
|
49
|
+
self.checkUUID = "local_" + ''.join(str(uuid.uuid4()).split('-'))
|
|
50
|
+
self.params["task_id"] = self.checkUUID
|
|
51
|
+
executeSuccess, result_obj = task.executeLocalPython(self.checkUUID, cmd, self.params, self.timeout)
|
|
52
|
+
if executeSuccess and result_obj["status"] == 0:
|
|
53
|
+
self.call_back(self.idx, result_obj["result"])
|
|
54
|
+
return
|
|
55
|
+
else:
|
|
56
|
+
self.checkUUID = ryry_webapi.createLocalTask(self.func, self.params, self.timeout)
|
|
48
57
|
else:
|
|
49
58
|
self.checkUUID = ryry_webapi.createTask(self.func, self.params)
|
|
50
59
|
time.sleep(wait_time_step)
|
|
@@ -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 5.
|
|
158
|
+
elif read_data["extend"].get("app", "") == "ryry-cli 5.4":
|
|
159
159
|
_genExtend()
|
|
160
160
|
else:
|
|
161
161
|
_genExtend()
|
|
@@ -215,22 +215,6 @@ def ftpUpload(file, new_file_name, subdomain, upload_path=""):
|
|
|
215
215
|
import ftplib
|
|
216
216
|
while retry < 3:
|
|
217
217
|
try:
|
|
218
|
-
#如果ip是外网ip,并且在FTP_REPLACEMENT内有,则先替换成内网ip上传一次
|
|
219
|
-
if retry == 0 and "192.168" not in ip and ip in FTP_REPLACEMENT:
|
|
220
|
-
try:
|
|
221
|
-
local_network_config = DOMAIN_CONFIG[FTP_REPLACEMENT[ip]]["config"]
|
|
222
|
-
ftp = ftplib.FTP()
|
|
223
|
-
ftp.connect(local_network_config["host"], local_network_config["port"], timeout=5)
|
|
224
|
-
ftp.login(local_network_config["username"], local_network_config["password"])
|
|
225
|
-
if upload_path:
|
|
226
|
-
s = deepFtpUpload(file, new_file_name, ftp, upload_path, readpath)
|
|
227
|
-
else:
|
|
228
|
-
s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
|
|
229
|
-
ftp.quit()
|
|
230
|
-
return s
|
|
231
|
-
except:
|
|
232
|
-
pass
|
|
233
|
-
|
|
234
218
|
if retry > 0:
|
|
235
219
|
has_bak = FTP_REPLACEMENT.get(ip, None)
|
|
236
220
|
if has_bak:
|
|
@@ -297,7 +281,7 @@ ftp_192_168_50_12={
|
|
|
297
281
|
"writepath" : "cache",
|
|
298
282
|
"readpath" : "ftp://219.136.123.179/mnt/NAS/mcn"
|
|
299
283
|
}
|
|
300
|
-
|
|
284
|
+
ftp_219_136_123_179={
|
|
301
285
|
"host" : "219.136.123.179",
|
|
302
286
|
"port": 2221,
|
|
303
287
|
"username" : "mcn",
|
|
@@ -345,11 +329,11 @@ def get_domain_config(target_domain):
|
|
|
345
329
|
|
|
346
330
|
DOMAIN_CONFIG = {
|
|
347
331
|
"192.168.50.12": {"type": "ftp", "config": ftp_192_168_50_12},
|
|
348
|
-
"219.136.123.179": {"type": "ftp", "config":
|
|
349
|
-
"183.6.90.205": {"type": "ftp", "config":
|
|
332
|
+
"219.136.123.179": {"type": "ftp", "config": ftp_219_136_123_179},
|
|
333
|
+
"183.6.90.205": {"type": "ftp", "config": ftp_219_136_123_179},
|
|
350
334
|
"ftp://192.168.50.12/mnt/NAS/mcn/cache": {"type": "ftp", "config": ftp_192_168_50_12},
|
|
351
|
-
"ftp://183.6.90.205/mnt/NAS/mcn/cache": {"type": "ftp", "config":
|
|
352
|
-
"ftp://219.136.123.179/mnt/NAS/mcn/cache": {"type": "ftp", "config":
|
|
335
|
+
"ftp://183.6.90.205/mnt/NAS/mcn/cache": {"type": "ftp", "config": ftp_219_136_123_179},
|
|
336
|
+
"ftp://219.136.123.179/mnt/NAS/mcn/cache": {"type": "ftp", "config": ftp_219_136_123_179},
|
|
353
337
|
"res.zjtemplate.com": {"type": "oss", "config": oss_res_config},
|
|
354
338
|
"upload.zjtemplate.com": {"type": "oss", "config": oss_upload_config},
|
|
355
339
|
"oss.zjtemplate.com": {"type": "oss", "config": oss_template_config},
|
|
@@ -360,16 +344,21 @@ DOMAIN_CONFIG = {
|
|
|
360
344
|
FTP_REPLACEMENT = {
|
|
361
345
|
"192.168.50.12": "219.136.123.179",
|
|
362
346
|
"219.136.123.179": "192.168.50.12",
|
|
347
|
+
"183.6.90.205": "219.136.123.179",
|
|
363
348
|
}
|
|
364
349
|
|
|
365
350
|
SUBDOMAIN = {
|
|
351
|
+
"183.6.90.205": [
|
|
352
|
+
ftp_192_168_50_12,
|
|
353
|
+
ftp_219_136_123_179,
|
|
354
|
+
],
|
|
366
355
|
"219.136.123.179": [
|
|
367
356
|
ftp_192_168_50_12,
|
|
368
|
-
|
|
357
|
+
ftp_219_136_123_179,
|
|
369
358
|
],
|
|
370
|
-
"192.168.50.
|
|
359
|
+
"192.168.50.12": [
|
|
371
360
|
ftp_192_168_50_12,
|
|
372
|
-
|
|
361
|
+
ftp_219_136_123_179,
|
|
373
362
|
]
|
|
374
363
|
}
|
|
375
364
|
|
|
@@ -688,4 +677,4 @@ def downloadDir(url, saveDir, useCount=-1, autoDelete=False):
|
|
|
688
677
|
print(f"url {url} not support")
|
|
689
678
|
except Exception as e:
|
|
690
679
|
print(f"downloadDir fail: {e}")
|
|
691
|
-
return None
|
|
680
|
+
return None
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|