def openfiles(self):
""" Open dialog for selecting CIF files"""
options = {}
options['initialdir'] = '{0}'.format(os.path.expanduser('~'))
options['filetypes'] = [('all files', '.*'), ('CIF files', '.cif')]
options['title'] = 'CIF files for processing'
options['defaultextension'] = '.cif'
filenames = tkFileDialog.askopenfilenames(parent=self.parent, **options)
filelist = self.parent.tk.splitlist(filenames)
for file in filelist:
if os.path.normpath(file) not in self.filenames:
self.filenames.append(os.path.normpath(file))
self.filebox.insert(tk.END, os.path.basename(file) )
if len(self.filenames) > 0:
self.clearbutton.configure(state='normal')
评论列表
文章目录