svnclient = pysvn.Client(local_excel) changes = svnclient.status(local_excel) #这里是获取svn modified,我主要是获取改动的excel文件 change_exc = [f.path for f in changes if f.text_status == pysvn.wc_status_kind.modified]
#我自己做的一些其他处理,可不管 parconf = parse_config.parsetable need_parese = [] for i in change_exc: xls_name = i.split("文档\\")[1].replace('\\', '/') print(xls_name) targetpath = remotepath + xls_name localpath = i.replace('\\', '/') # print("本地位置----", localpath, "目标位置----", targetpath) sftp.put(localpath, targetpath) parse_file = "文档\\" + xls_name for k, v in parconf.items(): for ls in v: if ls["parse_file"] == parse_file: need_parese.append(k) break print(need_parese) tran.close()