Changeset e540cd2 in sasview for src/sas/qtgui/GuiUtils.py
- Timestamp:
- Jul 7, 2016 2:54:18 AM (8 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:
- 0cd8612
- Parents:
- f0f309d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GuiUtils.py
r481ff26 re540cd2 80 80 fObj, path_config, descr = imp.find_module(confg_file, [path]) 81 81 config_module = imp.load_module(confg_file, fObj, path_config, descr) 82 except :82 except ImportError: 83 83 logging.error("Error loading %s/%s: %s" % (path, confg_file, sys.exc_value)) 84 84 finally: … … 104 104 logging.info("using default local_config") 105 105 else: 106 logging.info("found local_config in %s" %os.getcwd())106 logging.info("found local_config in %s", os.getcwd()) 107 107 else: 108 logging.info("found local_config in %s" %PATH_APP)108 logging.info("found local_config in %s", PATH_APP) 109 109 110 110 … … 118 118 logging.info(msgConfig) 119 119 else: 120 logging.info("using custom_config in %s" %os.getcwd())120 logging.info("using custom_config in %s", os.getcwd()) 121 121 else: 122 logging.info("using custom_config from %s" %c_conf_dir)122 logging.info("using custom_config from %s", c_conf_dir) 123 123 124 124 #read some constants from config … … 154 154 else: 155 155 DEFAULT_OPEN_FOLDER = PATH_APP 156 except :156 except AttributeError: 157 157 DATALOADER_SHOW = True 158 158 TOOLBAR_SHOW = True … … 181 181 try: 182 182 PLUGINS_WLIST = '|'.join(config.PLUGINS_WLIST) 183 except :183 except AttributeError: 184 184 PLUGINS_WLIST = '' 185 185 APPLICATION_WLIST = config.APPLICATION_WLIST … … 214 214 plotRequestedSignal = QtCore.pyqtSignal(str) 215 215 216 # Progress bar update value 217 progressBarUpdateSignal = QtCore.pyqtSignal(int) 218 216 219 217 220 def updateModelItem(item, update_data, name=""): … … 220 223 Adds QVariant 'update_data' to that row. 221 224 """ 222 assert type(item) == QtGui.QStandardItem223 assert type(update_data) == QtCore.QVariant225 assert isinstance(item, QtGui.QStandardItem) 226 assert isinstance(update_data, QtCore.QVariant) 224 227 225 228 checkbox_item = QtGui.QStandardItem(True) … … 230 233 # Add "Info" item 231 234 py_update_data = update_data.toPyObject() 232 if type(py_update_data) == (Data1D or Data2D):235 if isinstance(py_update_data, (Data1D or Data2D)): 233 236 # If Data1/2D added - extract Info from it 234 237 info_item = infoFromData(py_update_data) … … 254 257 Returns the list of plots for items in the model which are checked 255 258 """ 256 assert type(model_item) == QtGui.QStandardItemModel 257 258 checkbox_item = QtGui.QStandardItem(True) 259 assert isinstance(model_item, QtGui.QStandardItemModel) 260 259 261 plot_data = [] 260 261 262 # Iterate over model looking for items with checkboxes 262 263 for index in range(model_item.rowCount()): … … 279 280 and add them to a model item 280 281 """ 281 assert type(data) in [Data1D, Data2D]282 assert isinstance(data, (Data1D, Data2D)) 282 283 283 284 info_item = QtGui.QStandardItem("Info")
Note: See TracChangeset
for help on using the changeset viewer.