def __init__(self): self.path = r'F:\UserGroupPortraitDataCheck\filenames\basic_filename.txt' self.severse_path = r'F:\UserGroupPortraitData\basic' self.new_path = (GetNewFilePath.new_filenamepath( self.path, self.severse_path))
import QJC0831.GetNewFilePath as GetNewFilePath import paramiko import os path = r'F:\data_resource\file_xzt\filenames\app_filename.txt' severse_path = '/home/appSys/RIOpenApi4UMC/xzt1/app' new_path = (GetNewFilePath.new_filenamepath(path, severse_path)) def sftp_down_file(server_path, local_path): try: t = paramiko.Transport(GetNewFilePath.conf['host_ip'], GetNewFilePath.conf['port']) t.connect(username=GetNewFilePath.conf['username'], password=GetNewFilePath.conf['password']) sftp = paramiko.SFTPClient.from_transport(t) sftp.get(server_path, local_path) t.close() except Exception as e: print(e) def getfilename(path): for (path, path_, filename) in os.walk(path): return filename data_path = [] if len(new_path) == 0: print('服务器还没有上传新app文件!') else:
def __init__(self): self.path = r'/home/appSys/RIOpenApi4UMC/userportrait/filenames/app_filename.txt' self.severse_path = r'/home/appSys/RIOpenApi4UMC/userportrait/app' self.new_path = (GetNewFilePath.new_filenamepath( self.path, self.severse_path))