def Combine_Files_with_Network(self): #, Gel_db):
"""Select one or more Gellish files in a dialog and import files into the database tables,
after syntactic verification, but without consistency verification.
"""
# Select one or more files to be imported
file_path_names = filedialog.askopenfilenames(filetypes=[("CSV files","*.csv"),("JSON files","*.json"),\
("All files","*.*")], title="Select file")
#print('Selected file(s):',modelFiles)
if file_path_names == '':
Message(self.Gel_net.GUI_lang_index, \
'\nThe file name is blank or the inclusion is cancelled. There is no file read.',\
'\nDe file naam is blanco of het inlezen is gecancelled. Er is geen file ingelezen.')
return
# Read file(s)
for file_path_and_name in file_path_names:
# Split file_path_and_name in file path and file name
path_name = file_path_and_name.rsplit('/', maxsplit=1)
if len(path_name) == 2:
Message(self.Gel_net.GUI_lang_index, \
'\nReading file <{}> from directory {}.'.format(path_name[1], path_name[0]),\
'\nLees file <{}> van directory {}.'.format(path_name[1], path_name[0]))
file_name = path_name[1]
file_path = path_name[0]
else:
Message(self.Gel_net.GUI_lang_index, \
'\nReading file <{}> from current directory.'.format(file_path_and_name),\
'\nLees file <{}> van actuele directory.'.format(file_path_and_name))
file_name = file_path_and_name
file_path = ''
# Create file object
file = Gellish_file(file_path_and_name, self.Gel_net)
# Import expressions from file
self.Import_Gellish_from_file(file) #, Gel_db)
self.files_read.append(file)
## Message(self.Gel_net.GUI_lang_index, \
## '\nRead file : %s is added to list of read files.' % (file.path_and_name),\
## '\nGelezen file: %s is toegevoegd aan lijst van gelezen files.\n' % (file.path_and_name))
评论列表
文章目录