def request_config_file_name(self, open_flag=True): _caption = 'Select or Define a Configuration File Name' _current_folder = self.parent.configuration_folder if open_flag: _file = QFileDialog.getOpenFileName(parent=self.parent, filter='config (*.cfg)', caption=_caption, directory=_current_folder) if isinstance(_file, tuple): _file = _file[0] else: _file, _ = get_save_file(parent=self.parent, filter={'config (*.cfg)':'cfg'}, caption=_caption, directory=_current_folder) if not _file: self.filename = '' return _new_path = os.path.dirname(_file) self.parent.configuration_folder = _new_path o_file_handler = FileHandler(filename=_file) o_file_handler.check_file_extension(ext_requested='cfg') self.filename = o_file_handler.filename
def _export(self): _current_folder = self.main_window.current_folder _table_file, _ = get_save_file(parent=self.main_window, caption="Select File", directory=_current_folder, filter={'text (*.txt)':'txt', 'All Files (*.*)':''}) if not _table_file: return if isinstance(_table_file, tuple): _table_file = _table_file[0] _file_handler = FileHandler(filename=_table_file) _file_handler.check_file_extension(ext_requested='txt') _table_file = _file_handler.filename _export_handler = ExportTable(parent=self.main_window, filename=_table_file) _export_handler.run()
def _export(self): _current_folder = self.parent_no_ui.current_folder _table_file = QFileDialog.getSaveFileName( parent=self.parent_no_ui, caption="Select File", directory=_current_folder, filter=("text (*.txt);; All Files (*.*)")) if not _table_file: return if isinstance(_table_file, tuple): _table_file = _table_file[0] _file_handler = FileHandler(filename=_table_file) _file_handler.check_file_extension(ext_requested='txt') _table_file = _file_handler.filename _export_handler = ExportTable(parent=self.parent_no_ui, filename=_table_file) _export_handler.run()
def _export(self): _current_folder = self.parent.current_folder _table_file, _ = get_save_file(parent=self.parent, caption="Select File", directory=_current_folder, filter={ 'text (*.txt)': 'txt', 'All Files (*.*)': '' }) if not _table_file: return if isinstance(_table_file, tuple): _table_file = _table_file[0] _file_handler = FileHandler(filename=_table_file) _file_handler.check_file_extension(ext_requested='txt') _table_file = _file_handler.filename _export_handler = ExportTable(parent=self.parent, filename=_table_file) _export_handler.run()