Changeset b0b09b9 in sasview for src/sas/qtgui/MainWindow/DataExplorer.py
- Timestamp:
- Oct 26, 2017 3:13:05 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 895e7359
- Parents:
- def64a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
- Property mode changed from 100644 to 100755
r88e1f57 rb0b09b9 155 155 Populate the Perspective combobox and define callbacks 156 156 """ 157 available_perspectives = sorted([p for p in Perspectives.PERSPECTIVES.keys()])157 available_perspectives = sorted([p for p in list(Perspectives.PERSPECTIVES.keys())]) 158 158 if available_perspectives: 159 159 self.cbFitting.clear() … … 240 240 241 241 self.manager.assign(manager) 242 for id, item in self.manager.get_all_data().ite ritems():242 for id, item in self.manager.get_all_data().items(): 243 243 self.updateModel(item.data, item.path) 244 244 … … 345 345 # Figure out which rows are checked 346 346 selected_items = [self.model.item(index) 347 for index in xrange(self.model.rowCount())347 for index in range(self.model.rowCount()) 348 348 if isItemReady(index)] 349 349 … … 400 400 else: 401 401 freeze_msg = "Unexpected number of theories copied: %i" % theories_copied 402 raise AttributeError , freeze_msg402 raise AttributeError(freeze_msg) 403 403 self.communicator.statusBarUpdateSignal.emit(freeze_msg) 404 404 # Actively switch tabs … … 411 411 new_item = item.clone() 412 412 # clone doesn't do deepcopy :( 413 for child_index in xrange(item.rowCount()):413 for child_index in range(item.rowCount()): 414 414 child_item = self.recursivelyCloneItem(item.child(child_index)) 415 415 new_item.setChild(child_index, child_item) … … 435 435 return 436 436 new_plots = [PlotHelper.plotById(plot) for plot in graph_list] 437 active_plots_copy = self.active_plots.keys()437 active_plots_copy = list(self.active_plots.keys()) 438 438 for plot in active_plots_copy: 439 439 if self.active_plots[plot] in new_plots: … … 478 478 for plot in plots: 479 479 plot_id = plot.id 480 if plot_id in self.active_plots.keys():480 if plot_id in list(self.active_plots.keys()): 481 481 self.active_plots[plot_id].replacePlot(plot_id, plot) 482 482 else: … … 530 530 else: 531 531 msg = "Incorrect data type passed to Plotting" 532 raise AttributeError , msg532 raise AttributeError(msg) 533 533 534 534 if 'new_plot' in locals() and \ … … 597 597 598 598 id = data.id 599 if data.id in self.active_plots.keys():599 if data.id in list(self.active_plots.keys()): 600 600 self.active_plots[id].replacePlot(id, data) 601 601 … … 610 610 # But only with Qt built-in dialog (non-platform native) 611 611 paths = QtGui.QFileDialog.getOpenFileNames(self, "Choose a file", "", 612 wlist, None,QtGui.QFileDialog.DontUseNativeDialog)612 wlist, QtGui.QFileDialog.DontUseNativeDialog) 613 613 if paths is None: 614 614 return 615 615 616 if isinstance(paths, QtCore.QStringList):617 paths = [str(f) for f in paths]616 #if isinstance(paths, QtCore.QStringList): 617 # paths = [str(f) for f in paths] 618 618 619 619 if not isinstance(paths, list): … … 687 687 688 688 except Exception as ex: 689 logging.error(sys.exc_ value)689 logging.error(sys.exc_info()[1]) 690 690 691 691 any_error = True … … 747 747 if not isinstance(index, int): 748 748 msg = "Incorrect type passed to DataExplorer.selectData()" 749 raise AttributeError , msg749 raise AttributeError(msg) 750 750 751 751 # Respond appropriately … … 773 773 except AttributeError: 774 774 msg = "Bad structure of the data model." 775 raise RuntimeError , msg775 raise RuntimeError(msg) 776 776 777 777 if is1D: … … 787 787 except AttributeError: 788 788 msg = "Bad structure of the data model." 789 raise RuntimeError , msg789 raise RuntimeError(msg) 790 790 791 791 if item.isCheckable() and item.checkState() == QtCore.Qt.Checked and is1D: … … 801 801 except AttributeError: 802 802 msg = "Bad structure of the data model." 803 raise RuntimeError , msg803 raise RuntimeError(msg) 804 804 805 805 if is2D: … … 815 815 except AttributeError: 816 816 msg = "Bad structure of the data model." 817 raise RuntimeError , msg817 raise RuntimeError(msg) 818 818 819 819 if item.isCheckable() and item.checkState() == QtCore.Qt.Checked and is2D: … … 823 823 msg = "Incorrect value in the Selection Option" 824 824 # Change this to a proper logging action 825 raise Exception , msg825 raise Exception(msg) 826 826 827 827 def contextMenu(self): … … 1016 1016 # Add the actual Data1D/Data2D object 1017 1017 object_item = QtGui.QStandardItem() 1018 object_item.setData( QtCore.QVariant(data))1018 object_item.setData(data) 1019 1019 1020 1020 checkbox_item.setChild(0, object_item) … … 1040 1040 if not isinstance(model_item, QtGui.QStandardItem): 1041 1041 msg = "Wrong data type returned from calculations." 1042 raise AttributeError , msg1042 raise AttributeError(msg) 1043 1043 1044 1044 # TODO: Assert other properties … … 1057 1057 if not isinstance(model_item, QtGui.QStandardItem): 1058 1058 msg = "Wrong data type returned from calculations." 1059 raise AttributeError , msg1059 raise AttributeError(msg) 1060 1060 1061 1061 # Check if there are any other items for this tab … … 1064 1064 # 1065 1065 current_tab_name = model_item.text()[:2] 1066 for current_index in xrange(self.theory_model.rowCount()):1066 for current_index in range(self.theory_model.rowCount()): 1067 1067 if current_tab_name in self.theory_model.item(current_index).text(): 1068 1068 self.theory_model.removeRow(current_index)
Note: See TracChangeset
for help on using the changeset viewer.