taotoolkit 1.0.4__tar.gz → 1.0.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taotoolkit
3
- Version: 1.0.4
3
+ Version: 1.0.7
4
4
  Summary: Tao ToolKit
5
5
  Author-email: taotaoli <taotaoli@asrmicro.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "taotoolkit"
7
- version = "1.0.4"
7
+ version = "1.0.7"
8
8
  description = "Tao ToolKit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -940,8 +940,8 @@ class CamDvt(asrCamOp):
940
940
  fullpath1 = os.path.join(outPath, ch1)
941
941
  newfile0 = os.path.join(outPath, str(posCode) + "_L.vrf")
942
942
  newfile1 = os.path.join(outPath, str(posCode) + "_R.vrf")
943
- renameFile(newfile0, fullpath0)
944
- renameFile(newfile1, fullpath1)
943
+ renameFile(fullpath0, newfile0)
944
+ renameFile(fullpath1, newfile1)
945
945
  else:
946
946
  print("抓取vrf失败")
947
947
  sys.exit()
@@ -200,6 +200,9 @@ def removeAnyContainStr(string: str, subStringList: list, matchCase=True) -> Lis
200
200
 
201
201
 
202
202
  def renameFile(old_path: str, new_path: str) -> None:
203
+ logd("Rename file:", old_path, "to", new_path)
204
+ if os.path.exists(new_path):
205
+ os.remove(new_path)
203
206
  os.rename(old_path, new_path)
204
207
 
205
208
 
@@ -385,7 +385,7 @@ class DevOp:
385
385
 
386
386
  cmd3 = f"--size {recordWidth}x{recordHeight} /sdcard/{mp4Name}"
387
387
  cmd = f"{cmd1} {cmd2} {cmd3}"
388
- if sysVersion == "Linux":
388
+ if sysVersion == "linux":
389
389
  pCmd(cmd, showCmd=True, splitCmd=False, shell=True, logLevel="info", waitDone=False)
390
390
  else:
391
391
  pCmd(cmd, showCmd=True, splitCmd=False, shell=False, logLevel="info", waitDone=False)
@@ -52,13 +52,13 @@ class jenkinsTool:
52
52
  self.isUserDebug = True if isUserDebug == "1" else False
53
53
  self.packageFile = "release.zip"
54
54
  self.retainUserData = False # 是否保留用户数据,默认不保留
55
- if sysVersion == "Linux":
55
+ if sysVersion == "linux":
56
56
  self.downloadPath = "/home/local/Downloads/jenkin" # 下载路径和解压路径
57
- self.extractPath = "/home/local/Downloads/jenkin"
57
+ self.extractPath = self.downloadPath
58
58
  self.aimgTool = "aimgtool"
59
59
  else:
60
60
  self.downloadPath = r"D:\jenkin" # 下载路径和解压路径
61
- self.extractPath = r"D:\jenkin"
61
+ self.extractPath = self.downloadPath
62
62
  self.aimgTool = "aimgtool.exe"
63
63
  # logi(f"download package to {self.downloadPath}")
64
64
 
@@ -341,7 +341,7 @@ class jenkinsTool:
341
341
  return dict_from_list
342
342
 
343
343
  def browserDownload(self, url, timeOut=600):
344
- if sysVersion == "Linux":
344
+ if sysVersion == "linux":
345
345
  browser = "wget"
346
346
  else:
347
347
  browser = "C:\\Program Files\\Mozilla Firefox\\firefox.exe -headless"
@@ -511,12 +511,11 @@ class jenkinsTool:
511
511
  logd(f"{url} {dest_path}")
512
512
  start = time.time()
513
513
 
514
- windowsDownloadPath = r"D:\jenkin"
515
- if sysVersion == "Linux":
514
+ if sysVersion == "linux":
516
515
  targetZip = os.path.join(os.getcwd(), self.packageFile)
517
516
  else:
518
- targetZip = os.path.join(windowsDownloadPath, self.packageFile)
519
- partFile = findFilesBySuffixKeyword(windowsDownloadPath, ".part", "release")
517
+ targetZip = os.path.join(self.downloadPath, self.packageFile)
518
+ partFile = findFilesBySuffixKeyword(self.downloadPath, ".part", "release")
520
519
  for i in partFile:
521
520
  os.remove(targetZip)
522
521
 
@@ -635,7 +634,7 @@ class jenkinsTool:
635
634
  logi(f"download {finalCfg}, wait for download port ready ... ")
636
635
  refreshWait("usbdownload", 60, 0.3, self.getInfo, devSerial)
637
636
  cmd = ""
638
- if sysVersion == "Linux":
637
+ if sysVersion == "linux":
639
638
  cmd = f"./{self.aimgTool} download -t {finalCfg}"
640
639
  else:
641
640
  cmd = f"{self.aimgTool} download -t {finalCfg}"
@@ -761,7 +760,7 @@ def getInfo(acmd):
761
760
 
762
761
 
763
762
  def CLI_aimgDownload(args):
764
- if sysVersion == "Linux":
763
+ if sysVersion == "linux":
765
764
  aimgTool = "aimgtool"
766
765
  acmd = "./aimgtool"
767
766
  else:
@@ -540,7 +540,7 @@ class asrCamOp(DevOp):
540
540
  def __init__(self, checkCam=False, useUi=False, **kwargs):
541
541
  logd(f"needroot = {kwargs.get('needRoot', False)}, serial = {kwargs.get('serial', '')}")
542
542
  super().__init__(**kwargs)
543
- if sysVersion == "Linux":
543
+ if sysVersion == "linux":
544
544
  self.tuning_assistant = "tuning_assistant64.out"
545
545
  else:
546
546
  self.tuning_assistant = "tuning_assistant64.exe"
@@ -623,7 +623,7 @@ class asrCamOp(DevOp):
623
623
  def netCon(self, on=True):
624
624
  if on:
625
625
  logi("ip connect on")
626
- if sysVersion == "Linux":
626
+ if sysVersion == "linux":
627
627
  rCmd(
628
628
  "echo AAbbcc123 |sudo -S sysctl -w net.ipv4.conf.enp3s0.route_localnet=1",
629
629
  showCmd=True,
@@ -660,7 +660,7 @@ class asrCamOp(DevOp):
660
660
 
661
661
  else:
662
662
  logi("ip connect off")
663
- if sysVersion == "Linux":
663
+ if sysVersion == "linux":
664
664
  rCmd(
665
665
  "sudo iptables -t nat -F PREROUTING ",
666
666
  showRet=True,
@@ -686,7 +686,7 @@ class asrCamOp(DevOp):
686
686
  self.tuningGetModuleGroup()
687
687
 
688
688
  def readIsp(self, CFliter: str, param: str, row=0, col=0, is_float=False, showCmd=False, module=0, group=0)-> Union[int, float]:
689
- if sysVersion == "Linux":
689
+ if sysVersion == "linux":
690
690
  eExit("tuning_assistant not support linux")
691
691
  cmd = f"{self.tuning_assistant} 127.0.0.1 t 3000 3000 3000 r m{module}_g{group} {CFliter} {param} {row} {col}"
692
692
  try:
@@ -712,7 +712,7 @@ class asrCamOp(DevOp):
712
712
  return 0
713
713
 
714
714
  def writeIsp(self, CFliter: str, param: str, row: int, col: int, value: Union[int, float], showCmd=False):
715
- if sysVersion == "Linux":
715
+ if sysVersion == "linux":
716
716
  eExit("tuning_assistant not support linux")
717
717
  if isinstance(value, float):
718
718
  cf = ctypes.c_float(value)
@@ -947,7 +947,7 @@ class asrCamOp(DevOp):
947
947
  newfile = os.path.join(outPath, str(vrfName))
948
948
  from .tao_common import renameFile
949
949
 
950
- renameFile(newfile, fullpath)
950
+ renameFile(fullpath,newfile)
951
951
  else:
952
952
  eExit("抓取vrf失败")
953
953
 
@@ -1153,8 +1153,8 @@ def CLI_capVrf(argsList):
1153
1153
 
1154
1154
 
1155
1155
  def CLI_saveTuning(argsList):
1156
- if sysVersion == "Linux":
1157
- loge("Linux not support save tuning!")
1156
+ if sysVersion == "linux":
1157
+ loge("linux not support save tuning!")
1158
1158
  return
1159
1159
  parser = argparse.ArgumentParser(prog="savetuning", description="保存tuning参数")
1160
1160
  parser.add_argument("-a", "--all", type=str, default="1", choices=["0", "1"], help="是否保存包含RO的参数")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taotoolkit
3
- Version: 1.0.4
3
+ Version: 1.0.7
4
4
  Summary: Tao ToolKit
5
5
  Author-email: taotaoli <taotaoli@asrmicro.com>
6
6
  License-Expression: MIT
File without changes
File without changes