def select_caps_folder(self):
openFileDialog = wx.FileDialog(self, "Select caps folder", "", "", "JPG files (*.jpg)|*.jpg", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
openFileDialog.SetMessage("Select an image from the caps folder you want to import")
if openFileDialog.ShowModal() == wx.ID_CANCEL:
return 'none'
new_cap_path = openFileDialog.GetPath()
capsdir = os.path.split(new_cap_path)
capset = capsdir[1].split(".")[0][0:-10] # Used to select set if more than one are present
cap_type = capsdir[1].split('.')[1]
capsdir = capsdir[0] + '/'
print(" Selected " + capsdir + " with capset; " + capset + " filetype; " + cap_type)
return capsdir, capset, cap_type
评论列表
文章目录