ryry-cli 2.75__tar.gz → 2.77__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 (28) hide show
  1. {ryry_cli-2.75 → ryry_cli-2.77}/PKG-INFO +1 -1
  2. ryry_cli-2.77/ryry/constant.py +4 -0
  3. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_server_socket.py +13 -3
  4. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_webapi.py +33 -8
  5. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/upload.py +2 -2
  6. {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/PKG-INFO +1 -1
  7. {ryry_cli-2.75 → ryry_cli-2.77}/setup.py +1 -1
  8. ryry_cli-2.75/ryry/constant.py +0 -4
  9. {ryry_cli-2.75 → ryry_cli-2.77}/LICENSE +0 -0
  10. {ryry_cli-2.75 → ryry_cli-2.77}/README.md +0 -0
  11. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/__init__.py +0 -0
  12. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/main.py +0 -0
  13. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_service.py +0 -0
  14. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_widget.py +0 -0
  15. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/script_template/__init__.py +0 -0
  16. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/script_template/main.py +0 -0
  17. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/script_template/run.py +0 -0
  18. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/server_func.py +0 -0
  19. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/store.py +0 -0
  20. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/task.py +0 -0
  21. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/taskUtils.py +0 -0
  22. {ryry_cli-2.75 → ryry_cli-2.77}/ryry/utils.py +0 -0
  23. {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/SOURCES.txt +0 -0
  24. {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/dependency_links.txt +0 -0
  25. {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/entry_points.txt +0 -0
  26. {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/requires.txt +0 -0
  27. {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/top_level.txt +0 -0
  28. {ryry_cli-2.75 → ryry_cli-2.77}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.75
3
+ Version: 2.77
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -0,0 +1,4 @@
1
+ #!!!!! do not change this file !!!!!
2
+ app_version="2.77"
3
+ app_bulld_anchor="Noh_2024-12-27 15:57:32.610725"
4
+ app_name="ryry-cli"
@@ -169,12 +169,13 @@ class RyryShortConnectThread(Thread):
169
169
 
170
170
  def run(self):
171
171
  print(f" {self.name} start")
172
- min_wait_time = 2
173
- max_wait_time = 30
172
+ min_wait_time = 5
173
+ max_wait_time = 60
174
174
  wait_time = min_wait_time
175
- consecutive_step = 2
175
+ consecutive_step = 10
176
176
  consecutive_failures = 0
177
177
  max_consecutive_failures = 10
178
+ last_check_time = 0
178
179
 
179
180
  while (self.is_running):
180
181
  try:
@@ -194,6 +195,15 @@ class RyryShortConnectThread(Thread):
194
195
  if consecutive_failures >= max_consecutive_failures:
195
196
  wait_time = min(max_wait_time, wait_time + consecutive_step)
196
197
  consecutive_failures = 0
198
+
199
+
200
+ if calendar.timegm(time.gmtime()) - last_check_time > 600:
201
+ last_check_time = calendar.timegm(time.gmtime())
202
+ try:
203
+ min_wait_time, max_wait_time, consecutive_step = ryry_webapi.TaskConfig()
204
+ except:
205
+ pass
206
+
197
207
  except Exception as ex:
198
208
  taskUtils.taskPrint(None, f"{self.name} === exception : {ex}")
199
209
  time.sleep(wait_time)
@@ -1,7 +1,5 @@
1
- import json, os
2
- import datetime
3
- import uuid, requests
4
- import calendar, time
1
+ import json, os, locale, datetime, platform
2
+ import uuid, requests, calendar, time
5
3
 
6
4
  from ryry import store
7
5
  from ryry import utils
@@ -36,11 +34,38 @@ def _aigc_post(func, params, files={}, timeout=10):
36
34
  return -1, "", ""
37
35
 
38
36
  #======================================== Task Function ==============================
37
+ def ServerTaskConfig():
38
+ r1, r2, r3 = _aigc_post("aigc/task/config", {})
39
+ if r1 != 0:
40
+ raise Exception("")
41
+
42
+ min_wait_time = r3["min_wait_time"]
43
+ max_wait_time = r3["max_wait_time"]
44
+ consecutive_step = r3["step"]
45
+ return min_wait_time, max_wait_time, consecutive_step
46
+
47
+ GLOBAL_EXT_JSON = "{}"
39
48
  def _extend():
40
- extInfo = store.readDeviceInfo()
41
- extInfo["app"] = constant.app_name + " " + constant.app_version
42
- extInfo["host"] = utils.get_hostname()
43
- return json.dumps(extInfo)
49
+ global GLOBAL_EXT_JSON
50
+ if len(GLOBAL_EXT_JSON) < 10:
51
+ extInfo = store.readDeviceInfo()
52
+ extInfo["app"] = constant.app_name + " " + constant.app_version
53
+ extInfo["device"] = platform.system()
54
+ extInfo["device_version"] = platform.version()
55
+ extInfo["device_name"] = platform.node()
56
+ extInfo["device_model"] = platform.machine()
57
+
58
+ try:
59
+ extInfo["ip_address"] = requests.get('https://api.ipify.org').text
60
+ except Exception as e:
61
+ extInfo["ip_address"] = "unknown"
62
+
63
+ system_language, _ = locale.getdefaultlocale()
64
+ system_platform = platform.system().lower()
65
+ extInfo["language"] = system_language if system_language else "unknown"
66
+ extInfo["platform"] = system_platform if system_platform else "unknown"
67
+ GLOBAL_EXT_JSON = json.dumps(extInfo)
68
+ return GLOBAL_EXT_JSON
44
69
 
45
70
  def GetTask():
46
71
  widget_map = []
@@ -155,14 +155,14 @@ def getSubdomain(targetDomain):
155
155
  for ip in SUBDOMAIN.keys():
156
156
  for host_item in SUBDOMAIN[ip]:
157
157
  if targetDomain == host_item["readpath"]:
158
- if _can_connect_ftp(ip, host_item["username"], host_item["port"], host_item["password"], host_item["writepath"]):
158
+ if _can_connect_ftp(ip, host_item["port"], host_item["username"], host_item["password"], host_item["writepath"]):
159
159
  return host_item
160
160
  return None
161
161
 
162
162
  def getFirstSupportSubdomain():
163
163
  for ip in SUBDOMAIN.keys():
164
164
  for host_item in SUBDOMAIN[ip]:
165
- if _can_connect_ftp(ip, host_item["username"], host_item["port"], host_item["password"], host_item["writepath"]):
165
+ if _can_connect_ftp(ip, host_item["port"], host_item["username"], host_item["password"], host_item["writepath"]):
166
166
  return host_item
167
167
  return None
168
168
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.75
3
+ Version: 2.77
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.75"
6
+ ryry_version = "2.77"
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:
@@ -1,4 +0,0 @@
1
- #!!!!! do not change this file !!!!!
2
- app_version="2.75"
3
- app_bulld_anchor="Noh_2024-11-29 14:12:33.494076"
4
- app_name="ryry-cli"
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