def chooseDialogDir(self):
self.chooseDirPath = filedialog.askdirectory(
initialdir = self.chooseDirPath,
parent = self,
title = "Select Directory contains .SPE files",
)
print("select:", self.chooseDirPath)
if len(self.chooseDirPath) == 0:
return
self.chooseDirOutDir = filedialog.askdirectory(
initialdir = self.chooseDirPath,
parent = self,
title = "Select output Directory",
mustexist = False,
)
# TODO check wirte permission first
if not self.checkDir(self.chooseDirOutDir):
return
filenames = yieldFilesUnderDirectory(self.chooseDirPath,
match = "*.SPE")
if filenames is None:
messagebox.showinfo("Convert result", "No .SPE files under this directory")
return
self.convertFiles(filenames, self.chooseDirOutDir,
oldPrefix = self.chooseDirPath)
评论列表
文章目录