def _do_open_file (self, fpath): """ effective procedure for opening file to import; """ # is a genuine CSV file? if self.is_csv(fpath): # update options dir self.options["dirs"]["namedb_import_dir"] = OP.dirname(fpath) # update current path self.current_path = fpath # update file infos self.container.get_stringvar("lbl_file_path")\ .set(P.shorten_path(fpath, limit=50)) # show contents preview self._fill_preview(fpath) # update field assignment order self._fill_fields(fpath) # prepare to import self.BTN_IMPORT.configure( text=_("Import"), command=self.slot_file_import ) self.stop_import = False # not a CSV file else: # notify user MB.showwarning( title=_("Attention"), message=_("Invalid CSV file format. Not supported."), parent=self, )