xtn-tools-pro 1.0.1.0.6__py3-none-any.whl → 1.0.1.0.8__py3-none-any.whl

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.
@@ -43,16 +43,23 @@ class ShellPro:
43
43
  """
44
44
  conn.run(cmd, warn=warn)
45
45
 
46
- def update_file(self, LOCAL_FILE, REMOTE_FILE):
46
+ def update_file(self, local_file, remote_file, mkdir=False):
47
47
  """
48
48
  覆盖远程文件
49
- :param LOCAL_FILE: 本地文件
50
- :param REMOTE_FILE: 远程文件
49
+ :param local_file: 本地文件
50
+ :param remote_file: 远程文件
51
+ :param mkdir: 是否先在远程创建该路径的文件夹
51
52
  :return:
52
53
  """
53
54
  for server_item in self.server_info_list:
54
- conn = server_item["server_item"]
55
- conn.put(LOCAL_FILE, REMOTE_FILE)
55
+ ip = server_item["ip"]
56
+ tips = server_item["tips"]
57
+ conn = server_item["conn"]
58
+ if mkdir:
59
+ cmd = f"mkdir -p {remote_file}"
60
+ self.run_shell(conn, cmd=cmd, warn=True)
61
+ conn.put(local_file, remote_file)
62
+ self.__logger.info(f"{tips}-{ip} 覆盖远程文件成功!!!")
56
63
 
57
64
 
58
65
  if __name__ == '__main__':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xtn-tools-pro
3
- Version: 1.0.1.0.6
3
+ Version: 1.0.1.0.8
4
4
  Summary: xtn 开发工具
5
5
  Author: xtn
6
6
  Author-email: czw011122@gmail.com
@@ -59,12 +59,12 @@ xtn_tools_pro/utils/helpers.py,sha256=OmPRxB6vDN1S7OhxQWgoOXnxs2YPorwSQKBVzYOiKo
59
59
  xtn_tools_pro/utils/log.py,sha256=mf5huJDA8xVxxFWPG_tl_vOsAA2_ywGDFycYSGHIDCo,10202
60
60
  xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,1657
61
61
  xtn_tools_pro/utils/set_data.py,sha256=BzCLbEDO83csDHBey8kP7SoE6kx6EjqE7OqRBY7k82s,17608
62
- xtn_tools_pro/utils/shell.py,sha256=CD0eXlCH_fZ9ylGo_H948aVe04Hd9oAHLYIGo3I71Bg,2300
62
+ xtn_tools_pro/utils/shell.py,sha256=FhyxtQmjQgaBg0BSLWp4_SuW20e6rYImz8cndxYOwPg,2657
63
63
  xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
64
64
  xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
65
- xtn_tools_pro-1.0.1.0.6.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
- xtn_tools_pro-1.0.1.0.6.dist-info/METADATA,sha256=5p96ZExOVfN5YFQh9p8zY4PQc-f5Fr_ImJWKC5BkN9Q,523
67
- xtn_tools_pro-1.0.1.0.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
68
- xtn_tools_pro-1.0.1.0.6.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
69
- xtn_tools_pro-1.0.1.0.6.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
70
- xtn_tools_pro-1.0.1.0.6.dist-info/RECORD,,
65
+ xtn_tools_pro-1.0.1.0.8.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
+ xtn_tools_pro-1.0.1.0.8.dist-info/METADATA,sha256=hI6Vp8AqAHAa7q11hrbtflD8W0Z4VSeD5dbAUYy9d88,523
67
+ xtn_tools_pro-1.0.1.0.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
68
+ xtn_tools_pro-1.0.1.0.8.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
69
+ xtn_tools_pro-1.0.1.0.8.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
70
+ xtn_tools_pro-1.0.1.0.8.dist-info/RECORD,,