def file_open_from_list(self): r"""Called when a new file is selected from the file list. This is an event call.""" if self.auto_change_active: return QtWidgets.QApplication.instance().processEvents() item = self.ui.file_list.currentItem() # type: QListWidgetItem name = unicode( item.text() ) # e.g 'REF_M_38199.nxs.h5' or 'REF_M_38198.nxs.h5+REF_M_38199.nxs.h5' filepath = FilePath.join(self.data_manager.current_directory, name) self.file_handler.open_file(filepath)
def test_join(self): assert FilePath.join(u'/SNS', u'REF_M_1.nxs') == u'/SNS/REF_M_1.nxs' assert FilePath.join( u'/SNS', u'REF_M_2.nxs+REF_M_1.nxs') == u'/SNS/REF_M_1.nxs+/SNS/REF_M_2.nxs'