ryry-cli 4.10__tar.gz → 4.12__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 (31) hide show
  1. {ryry_cli-4.10/ryry_cli.egg-info → ryry_cli-4.12}/PKG-INFO +1 -1
  2. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/constant.py +2 -2
  3. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/ryry_server_socket.py +1 -1
  4. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/shared_memory.py +9 -2
  5. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/upload.py +44 -14
  6. {ryry_cli-4.10 → ryry_cli-4.12/ryry_cli.egg-info}/PKG-INFO +1 -1
  7. {ryry_cli-4.10 → ryry_cli-4.12}/setup.py +1 -1
  8. {ryry_cli-4.10 → ryry_cli-4.12}/LICENSE +0 -0
  9. {ryry_cli-4.10 → ryry_cli-4.12}/README.md +0 -0
  10. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/__init__.py +0 -0
  11. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/daemon_base.py +0 -0
  12. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/daemon_manager.py +0 -0
  13. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/main.py +0 -0
  14. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/ryry_service.py +0 -0
  15. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/ryry_webapi.py +0 -0
  16. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/ryry_widget.py +0 -0
  17. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/script_template/__init__.py +0 -0
  18. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/script_template/daemon.py +0 -0
  19. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/script_template/main.py +0 -0
  20. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/script_template/run.py +0 -0
  21. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/server_func.py +0 -0
  22. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/store.py +0 -0
  23. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/task.py +0 -0
  24. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/taskUtils.py +0 -0
  25. {ryry_cli-4.10 → ryry_cli-4.12}/ryry/utils.py +0 -0
  26. {ryry_cli-4.10 → ryry_cli-4.12}/ryry_cli.egg-info/SOURCES.txt +0 -0
  27. {ryry_cli-4.10 → ryry_cli-4.12}/ryry_cli.egg-info/dependency_links.txt +0 -0
  28. {ryry_cli-4.10 → ryry_cli-4.12}/ryry_cli.egg-info/entry_points.txt +0 -0
  29. {ryry_cli-4.10 → ryry_cli-4.12}/ryry_cli.egg-info/requires.txt +0 -0
  30. {ryry_cli-4.10 → ryry_cli-4.12}/ryry_cli.egg-info/top_level.txt +0 -0
  31. {ryry_cli-4.10 → ryry_cli-4.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 4.10
3
+ Version: 4.12
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="4.10"
3
- app_bulld_anchor="Noh_2025-07-21 14:09:00.552333"
2
+ app_version="4.12"
3
+ app_bulld_anchor="Noh_2025-07-21 15:09:23.991341"
4
4
  app_name="ryry-cli"
5
5
  import sys, os
6
6
  if getattr(sys, 'frozen', False):
@@ -235,7 +235,7 @@ class RyryShortConnectThread(Thread):
235
235
 
236
236
  while (self.is_running):
237
237
  try:
238
- if self.executor.idlePower() == 0:
238
+ if self.executor.idlePower() <= 0:
239
239
  time.sleep(1)
240
240
  continue
241
241
 
@@ -541,24 +541,30 @@ class SharedMemoryService:
541
541
  def get_max_counter(self) -> int:
542
542
  """获取最大计数器(只读操作)"""
543
543
  data = self._read_data()
544
- return data.get("max_counter", 1)
544
+ max_counter = data.get("max_counter", 1)
545
+ print(f"get_max_counter = {max_counter}")
546
+ return max_counter
545
547
 
546
548
  def set_cur_counter(self, cur_counter: int):
547
549
  """设置当前计数器"""
548
550
  def operation(data):
549
551
  data["cur_counter"] = cur_counter
552
+ print(f"set_cur_counter = {cur_counter}")
550
553
  return cur_counter
551
554
  return self._atomic_operation(operation)
552
555
 
553
556
  def get_cur_counter(self) -> int:
554
557
  """获取当前计数器(只读操作)"""
555
558
  data = self._read_data()
556
- return data.get("cur_counter", 0)
559
+ cur_counter = data.get("cur_counter", 0)
560
+ print(f"get_cur_counter = {cur_counter}")
561
+ return cur_counter
557
562
 
558
563
  def increment_cur_counter(self) -> int:
559
564
  """增加当前计数器"""
560
565
  def operation(data):
561
566
  data["cur_counter"] = data.get("cur_counter", 0) + 1
567
+ print(f"increment_cur_counter")
562
568
  return data["cur_counter"]
563
569
  return self._atomic_operation(operation)
564
570
 
@@ -566,6 +572,7 @@ class SharedMemoryService:
566
572
  """减少当前计数器"""
567
573
  def operation(data):
568
574
  data["cur_counter"] = max(0, data.get("cur_counter", 0) - 1)
575
+ print(f"decrement_cur_counter")
569
576
  return data["cur_counter"]
570
577
  return self._atomic_operation(operation)
571
578
 
@@ -1,4 +1,5 @@
1
1
  from urllib.parse import *
2
+ import time
2
3
 
3
4
  def transcode(srcFile):
4
5
  try:
@@ -71,10 +72,10 @@ def upload(src, taskUUID=None, needTranscode=False, keepItAlways=False, addition
71
72
  uploadPath = os.path.join('/mnt/NAS/mcn/', uploadPath)
72
73
 
73
74
 
75
+ needDeleteSrc = False
74
76
  if needTranscode:
75
77
  needDeleteSrc, newSrc = transcode(src)
76
78
  else:
77
- needDeleteSrc = False
78
79
  newSrc = src
79
80
 
80
81
  # 根据targetDomain判断使用不同的上传逻辑
@@ -182,7 +183,6 @@ def uploadToOss(file, new_file_name, oss_config, upload_path=""):
182
183
  raise Exception(f"OSS upload failed: {response.status_code}")
183
184
 
184
185
  def deepFtpUpload(file, new_file_name, ftp, writepath, readpath):
185
- import ftplib, os
186
186
  try:
187
187
  safe_cwd(ftp, writepath)
188
188
  except:
@@ -200,20 +200,45 @@ def ftpUpload(file, new_file_name, subdomain, upload_path=""):
200
200
  password = subdomain["password"]
201
201
  writepath = subdomain["writepath"]
202
202
  readpath = subdomain["readpath"]
203
+ retry = 0
203
204
  import ftplib
204
- ftp = ftplib.FTP()
205
- ftp.connect(ip, port, timeout=5)
206
- ftp.login(username, password)
205
+ while retry < 3:
206
+ try:
207
+ if retry > 0:
208
+ has_bak = FTP_REPLACEMENT.get(ip, None)
209
+ if has_bak:
210
+ bak_config = DOMAIN_CONFIG.get(has_bak, None)["config"]
211
+ ftp = ftplib.FTP()
212
+ ftp.connect(bak_config["host"], bak_config["port"], timeout=5)
213
+ ftp.login(bak_config["username"], bak_config["password"])
214
+ if upload_path:
215
+ if upload_path[0:1] == "/":
216
+ upload_path = upload_path[1:]
217
+ s = deepFtpUpload(file, new_file_name, ftp, upload_path, f'ftp://{ip}/{upload_path}')
218
+ else:
219
+ s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
220
+
221
+ ftp.quit()
222
+ return s
207
223
 
208
- if upload_path:
209
- if upload_path[0:1] == "/":
210
- upload_path = upload_path[1:]
211
- s = deepFtpUpload(file, new_file_name, ftp, upload_path, f'ftp://{ip}/{upload_path}')
212
- else:
213
- s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
214
-
215
- ftp.quit()
216
- return s
224
+ ftp = ftplib.FTP()
225
+ ftp.connect(ip, port, timeout=5)
226
+ ftp.login(username, password)
227
+
228
+ if upload_path:
229
+ if upload_path[0:1] == "/":
230
+ upload_path = upload_path[1:]
231
+ s = deepFtpUpload(file, new_file_name, ftp, upload_path, f'ftp://{ip}/{upload_path}')
232
+ else:
233
+ s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
234
+
235
+ ftp.quit()
236
+ return s
237
+ except:
238
+ time.sleep(5)
239
+ finally:
240
+ retry+=1
241
+ raise Exception("uplad fail!")
217
242
 
218
243
  def _can_connect_ftp(ip, port, username, password, writepath):
219
244
  import ftplib
@@ -299,6 +324,11 @@ DOMAIN_CONFIG = {
299
324
  "*.mecordai.com": {"type": "mecord-cli", "config": {}},
300
325
  }
301
326
 
327
+ FTP_REPLACEMENT = {
328
+ "192.168.50.12": "183.6.90.205",
329
+ "183.6.90.205": "192.168.50.12",
330
+ }
331
+
302
332
  SUBDOMAIN = {
303
333
  "183.6.90.205": [
304
334
  ftp_192_168_50_12,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 4.10
3
+ Version: 4.12
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 = "4.10"
6
+ ryry_version = "4.12"
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes