Changeset e540cd2 in sasview for src/sas/qtgui/GuiUtils.py


Ignore:
Timestamp:
Jul 7, 2016 2:54:18 AM (8 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
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
Message:

Status bar, progress bar, initial treeview context menu + minor cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/GuiUtils.py

    r481ff26 re540cd2  
    8080        fObj, path_config, descr = imp.find_module(confg_file, [path]) 
    8181        config_module = imp.load_module(confg_file, fObj, path_config, descr) 
    82     except: 
     82    except ImportError: 
    8383        logging.error("Error loading %s/%s: %s" % (path, confg_file, sys.exc_value)) 
    8484    finally: 
     
    104104        logging.info("using default local_config") 
    105105    else: 
    106         logging.info("found local_config in %s" % os.getcwd()) 
     106        logging.info("found local_config in %s", os.getcwd()) 
    107107else: 
    108     logging.info("found local_config in %s" % PATH_APP) 
     108    logging.info("found local_config in %s", PATH_APP) 
    109109 
    110110 
     
    118118        logging.info(msgConfig) 
    119119    else: 
    120         logging.info("using custom_config in %s" % os.getcwd()) 
     120        logging.info("using custom_config in %s", os.getcwd()) 
    121121else: 
    122     logging.info("using custom_config from %s" % c_conf_dir) 
     122    logging.info("using custom_config from %s", c_conf_dir) 
    123123 
    124124#read some constants from config 
     
    154154    else: 
    155155        DEFAULT_OPEN_FOLDER = PATH_APP 
    156 except: 
     156except AttributeError: 
    157157    DATALOADER_SHOW = True 
    158158    TOOLBAR_SHOW = True 
     
    181181try: 
    182182    PLUGINS_WLIST = '|'.join(config.PLUGINS_WLIST) 
    183 except: 
     183except AttributeError: 
    184184    PLUGINS_WLIST = '' 
    185185APPLICATION_WLIST = config.APPLICATION_WLIST 
     
    214214    plotRequestedSignal = QtCore.pyqtSignal(str) 
    215215 
     216    # Progress bar update value 
     217    progressBarUpdateSignal = QtCore.pyqtSignal(int) 
     218 
    216219 
    217220def updateModelItem(item, update_data, name=""): 
     
    220223    Adds QVariant 'update_data' to that row. 
    221224    """ 
    222     assert type(item) == QtGui.QStandardItem 
    223     assert type(update_data) == QtCore.QVariant 
     225    assert isinstance(item, QtGui.QStandardItem) 
     226    assert isinstance(update_data, QtCore.QVariant) 
    224227 
    225228    checkbox_item = QtGui.QStandardItem(True) 
     
    230233    # Add "Info" item 
    231234    py_update_data = update_data.toPyObject() 
    232     if type(py_update_data) == (Data1D or Data2D): 
     235    if isinstance(py_update_data, (Data1D or Data2D)): 
    233236        # If Data1/2D added - extract Info from it 
    234237        info_item = infoFromData(py_update_data) 
     
    254257    Returns the list of plots for items in the model which are checked 
    255258    """ 
    256     assert type(model_item) == QtGui.QStandardItemModel 
    257  
    258     checkbox_item = QtGui.QStandardItem(True) 
     259    assert isinstance(model_item, QtGui.QStandardItemModel) 
     260 
    259261    plot_data = [] 
    260  
    261262    # Iterate over model looking for items with checkboxes 
    262263    for index in range(model_item.rowCount()): 
     
    279280    and add them to a model item 
    280281    """ 
    281     assert type(data) in [Data1D, Data2D] 
     282    assert isinstance(data, (Data1D, Data2D)) 
    282283 
    283284    info_item = QtGui.QStandardItem("Info") 
Note: See TracChangeset for help on using the changeset viewer.