Пример #1
0
    def __init__(self, runner=None):
        _OptionsModelMixin.__init__(self)
        QAbstractTableModel.__init__(self)

        self._runner = runner

        def _column0(runner, options):
            return str(options)
        def _column1(runner, options):
            STATE_ICONS = \
                {LocalRunner.STATE_QUEUED: getIcon('media-playback-pause'),
                 LocalRunner.STATE_RUNNING: getIcon('media-playback-start'),
                 LocalRunner.STATE_SIMULATED: getIcon('face-smile'),
                 LocalRunner.STATE_ERROR: getIcon('face-sad')}
            try:
                return STATE_ICONS.get(runner.options_state(options))
            except KeyError:
                return None
        def _column2(runner, options):
            try:
                progress = runner.options_progress(options) * 100
            except KeyError:
                progress = 0.0
            return '{0:n}%'.format(progress)
        def _column3(runner, options):
            try:
                return runner.options_status(options)
            except KeyError:
                return ''

        self._data_getter = {0: _column0, 1: _column1, 2: _column2, 3: _column3}
Пример #2
0
 def __init__(self, results, headerdata, parent=None, *args):
     """ datain: a list of lists
         headerdata: a list of strings
     """
     QAbstractTableModel.__init__(self, parent, *args)
     #self.arraydata = datain
     self.headerdata = headerdata
     self.results = results
Пример #3
0
 def __init__(self, results, headerdata, parent=None, *args): 
     """ datain: a list of lists
         headerdata: a list of strings
     """
     QAbstractTableModel.__init__(self, parent, *args) 
     #self.arraydata = datain
     self.headerdata = headerdata
     self.results = results
Пример #4
0
 def __init__(self, dataset = Dataset(), parent = None):
     '''Construtor de DatasetModel. 
     
     Parâmetros:
     
     dataset    : objeto Dataset para ser atribuído a *_dataset*
     '''
     QAbstractTableModel.__init__(self, parent)
     self._dataset = dataset
Пример #5
0
    def __init__(self, obsLightManager, projectName):
        QAbstractTableModel.__init__(self)
        self.__obsLightManager = obsLightManager
        self.__project = projectName
        self.__pkgList = None
        self.__getPackageList()

        if self.colors is None:
            self.__loadColors()
Пример #6
0
 def __init__(self, dataset=Dataset(), parent=None):
     '''Construtor de DatasetModel. 
     
     Parâmetros:
     
     dataset    : objeto Dataset para ser atribuído a *_dataset*
     '''
     QAbstractTableModel.__init__(self, parent)
     self._dataset = dataset
Пример #7
0
 def __init__(self, dados = [], parent = None):
     '''Construtor de DatasetModel. 
     
     Parâmetros:
     
     dados   : objeto Dataset para ser atribuído a *_dataset*
     '''
     QAbstractTableModel.__init__(self, parent)
     self._dados = dados
     self._estatistica = dados.describe()
    def __init__(self):
        """ Build the Transactions Table """
        QAbstractTableModel.__init__(self)
        self.columns = self.getColumns()

        self.roleResponses = {Qt.DisplayRole:self.getData,
                              Qt.EditRole:self.getData,
                              Qt.ToolTipRole:self.getTip,
                              Qt.StatusTipRole:self.getTip,
                              Qt.TextAlignmentRole:self.getTextAlignment}
Пример #9
0
    def __init__ ( self, editor, parent ):
        """ Initialise the object.
        """
        QAbstractTableModel.__init__( self, parent )

        self.setSupportedDragActions( Qt.CopyAction | Qt.MoveAction )

        self._editor = editor
        self._row    = editor.data_row_for
        self._font   = set()
Пример #10
0
 def __init__(self, tabList=None, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.__headers = [
         'Char', 'Freq', 'ASCII', 'Huff', u'Ĉ ASCII', u'Ĉ Huff']
     if tabList is None:
         tabList = [['' for x in range(len(self.__headers))]]
     for x in range(len(tabList)):
         missingCols = len(self.__headers) - len(tabList[x])
         for x in range(missingCols):
             tabList[x].append('/')
     self.__tabList = tabList
     self.hlRow = []
Пример #11
0
    def __init__(self,
                 table_data,
                 headers=[],
                 check_row=[],
                 executed_row=[],
                 parent=None):

        QAbstractTableModel.__init__(self, parent)
        self.check_row = check_row
        self.table_data = table_data
        self.headers = headers
        self.executed_row = executed_row
Пример #12
0
    def __init__(self):

        QAbstractTableModel.__init__(self)

        self.__state_current_data = None
        self.__state_cond = {}  # now sql condition
        self.__state_data = list()  # data
        self.__state_check = []  # checked list

        self.__state_fields_name = []  # fields CN name
        self.__state_fields_id = []  # data table field name
        self.__state_edit_fields = []
        self.__state_select = {}

        self._state_editable = False

        self.__service = None
Пример #13
0
    def __init__(self, result):
        QAbstractTableModel.__init__(self)
        self._result = result
        self._transitions = sorted(result.iter_transitions())

        self._header_sections = ["Transition", "PG", "PE", "CG", "CE", "BG", "BE", "TG", "TE"]
        self._data_funcs = [
            lambda r, t: r.intensity(t, False, False),
            lambda r, t: r.intensity(t, True, False),
            lambda r, t: r.characteristic_fluorescence(t, False),
            lambda r, t: r.characteristic_fluorescence(t, True),
            lambda r, t: r.bremsstrahlung_fluorescence(t, False),
            lambda r, t: r.bremsstrahlung_fluorescence(t, True),
            lambda r, t: r.intensity(t, False, True),
            lambda r, t: r.intensity(t, True, True),
        ]

        self._show_uncertainty = True
        self._factor = 1.0
Пример #14
0
 def __init__(self, watcher=None):
     """ Init model """
     QAbstractTableModel.__init__(self)
     self.table_view = None
     self.watcher = watcher
     self.watcher.fileChanged.connect(self.file_watch_file_change)
     self.watcher.directoryChanged.connect(self.file_watch_directory_change)
     self.is_reloading_file = False
     self.suspend_force_sort = False
     self.supported_format_dict = dict(
         [(n_type, nodeAttr) for n_type, nice, nodeAttr in MTTSettings.SUPPORTED_TYPE])
     self.db = None
     # create database table
     try:
         self._database_create_table()
     except sqlite3.Error, e:
         mtt_log('Error init DB :\n\t>> %s <<\n' % e, msg_type='error',
                 verbose=False)
         sys.exit(1)
 def __init__(self, obsLightManager, projectName, packageName):
     """
     Initialize the OscWorkingCopyModel.
     `obsLightManager`: a reference to the ObsLightManager.
     `projectName`: the name of the OBS project in which we are working.
     `packageName`: the name of the package we are managing the working copy of.
     """
     QAbstractTableModel.__init__(self)
     self.__obsLightManager = obsLightManager
     self.__project = projectName
     self.__package = packageName
     self.__columnList = list()
     self.__fileList = list()
     self.__fileInfos = dict()
     self.sortKey = None
     self.sortOrder = Qt.SortOrder.AscendingOrder
     # dict<unicode, dict<object, QColor>>
     self.colors = dict()
     self._loadColors()
     self.refresh()
Пример #16
0
 def __init__(self,
              obsLightManager,
              projectName,
              getDataDictListFunc,
              sortOnKey=None):
     """
     Initialize the model.
       obsLightManager:  an instance of `ObsLightManager`
       projectName:  the name of the MIC project this model will retrieve data from
       getDataDictListFunc:  a function taking a project name as parameter and
           returning a list of data dictionaries
     """
     QAbstractTableModel.__init__(self)
     self.__modified = False
     self.__dataDictList = None
     self.__manager = obsLightManager
     self.__project = projectName
     self.__getDataDictListFunc = getDataDictListFunc
     self.sortOnKey = sortOnKey
     self.refresh()
Пример #17
0
 def __init__(self, watcher=None):
     """ Init model """
     QAbstractTableModel.__init__(self)
     self.table_view = None
     self.watcher = watcher
     self.watcher.fileChanged.connect(self.file_watch_file_change)
     self.watcher.directoryChanged.connect(self.file_watch_directory_change)
     self.is_reloading_file = False
     self.suspend_force_sort = False
     self.supported_format_dict = dict([
         (n_type, nodeAttr)
         for n_type, nice, nodeAttr in MTTSettings.SUPPORTED_TYPE
     ])
     self.db = None
     # create database table
     try:
         self._database_create_table()
     except sqlite3.Error, e:
         mtt_log('Error init DB :\n\t>> %s <<\n' % e,
                 msg_type='error',
                 verbose=False)
         sys.exit(1)
Пример #18
0
 def __init__(self, table, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.table = table
Пример #19
0
 def __init__(self, warns=None):
     QAbstractTableModel.__init__(self)
     if warns is None:
         warns = []
     self._warns = warns
Пример #20
0
 def __init__(self, parent, list, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.list = list
     self.header = []
     self.generate_headers()
Пример #21
0
 def __init__(self, parent, mylist, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.mylist = mylist
     self.header = header
Пример #22
0
 def __init__(self):
     QAbstractTableModel.__init__(self)
     self._detectors = []
 def __init__(self, QObject_parent=None, turing=None):
     QAbstractTableModel.__init__(self, QObject_parent)
     self.set_machine(turing)
Пример #24
0
    def __init__(self, repoTuple):
        QAbstractTableModel.__init__(self)

        self._repoTuple = repoTuple
Пример #25
0
 def __init__(self):
     QAbstractTableModel.__init__(self)
     self._limits = []
Пример #26
0
 def __init__(self, parent, datalist, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.header = []
     self.list = []
     self.set_list(datalist, header)
Пример #27
0
 def __init__(self):
     QAbstractTableModel.__init__(self)
     self._models = []
 def __init__(self, QObject_parent=None, turing=None):
     QAbstractTableModel.__init__(self, QObject_parent)
     self.set_machine(turing)
Пример #29
0
 def __init__(self, parent, infoDict, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.infoDict = infoDict
     self.header_labels = header
Пример #30
0
 def __init__(self, parent, infoDict, header, *args):
   QAbstractTableModel.__init__(self, parent, *args)
   self.infoDict = infoDict
   self.header_labels = header
Пример #31
0
 def __init__(self, parent, header, data_list, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.data_list = data_list
     self.header = header
Пример #32
0
 def __init__(self, parent, datalist, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.header = []
     self.list = []
     self.set_list(datalist, header)
Пример #33
0
 def __init__(self, addons, latestVersions, parent=None):
     QAbstractTableModel.__init__(self, parent)        
     self.addons = addons
     self.latestVersions = latestVersions
     self.parent = parent
Пример #34
0
 def __init__(self, cards):
     QAbstractTableModel.__init__(self)
     self.cards = cards
     self.fields = ['name', 'skill', 'cost', 'attack', 'life']
     self.headers = [u'名称', u'技能', u'法力', u'攻击', u'血量']
Пример #35
0
 def __init__(self):
     QAbstractTableModel.__init__(self)
     self._layers = []
Пример #36
0
 def __init__(self, table, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.table = table
Пример #37
0
 def __init__(self, courses):
     QAbstractTableModel.__init__(self)
     # my object is a mapping, while table model uses an index (so it's
     # more similar to a list
     self.courses = list(courses)
Пример #38
0
 def __init__(self):
     QAbstractTableModel.__init__(self)
     self._forcings = []