Skip to content

Commit

Permalink
fix:文件路径有空格导致无法转换格式的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tcmyxc committed Sep 29, 2022
1 parent 007f454 commit 6867f8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kfb2tif.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ def click_btn(self):
print(f"正在转换第 {ok_cnt+1} 个文件, 一共有 {file_cnt} 个文件")
tif_dest_path = kfb_file.replace(root_path, f"{root_path}/tif")
tif_dest_path = tif_dest_path.replace(".kfb", ".tif")
command = f"{exe_path} {kfb_file} {tif_dest_path} {level}"
command = f'{exe_path} "{kfb_file}" "{tif_dest_path}" {level}' # 加双引号避免文件路径有空格
p = subprocess.Popen(command)
p.wait()
ok_cnt += 1
self.progressBar.setValue(ok_cnt)
self.advanceProgressBar()
print()

print("所有文件已经转换成功!!!")
print("\n所有文件已经转换成功!!!")

def advanceProgressBar(self):
curVal = self.progressBar.value()
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def click_btn(self):
print(f"正在转换第 {ok_cnt+1} 个文件, 一共有 {file_cnt} 个文件")
svs_dest_path = kfb_file.replace(root_path, f"{root_path}/svs")
svs_dest_path = svs_dest_path.replace(".kfb", ".svs")
command = f"{exe_path} {kfb_file} {svs_dest_path} {level}"
command = f'{exe_path} "{kfb_file}" "{svs_dest_path}" {level}' # 加双引号避免文件路径有空格
p = subprocess.Popen(command)
p.wait()
ok_cnt += 1
Expand Down

0 comments on commit 6867f8b

Please sign in to comment.