Beispiel #1
0
    def validate_setup_spec(self, spec):
        """Validate the 'setups' option.

        If there is a definitions of the old style of setup dependenciest a
        warning will be given.
        """
        setupspec = spec.options.get('setups', '')
        checkSetupSpec(setupspec, '', log=self.log)
Beispiel #2
0
 def reconfigureBoxes(self):
     emitdict = {}
     fields = []
     for (layout, box) in self._onlyblocks:
         emitdict[layout, box] = checkSetupSpec(box.setups, self._setups,
                                                log=self.log)
         # check fields inside the block, if the block isn't invisible
         if emitdict[layout, box]:
             fields.extend(box._onlyfields)
     # always check fields not in a setup controlled group
     fields.extend(self._onlyfields)
     for field in fields:
         emitdict[None, field] = checkSetupSpec(field.setups, self._setups,
                                                log=self.log)
     self._master.reconfigure.emit(emitdict)
Beispiel #3
0
def test_check_setup_spec():
    for spec, setups, result in CASES + OLDSTYLE_CASES:
        # print is here to aid in finding the offending input parameters
        # as the stacktrace doesn't output locals
        res = checkSetupSpec(spec, setups)
        print('testing checkSetupSpec(%r, %r) == %r: %r' %
              (spec, setups, result, res))
        assert res == result
Beispiel #4
0
 def reconfigureBoxes(self):
     fields = []
     for block in self._onlyblocks:
         block.enabled = checkSetupSpec(block.setups, self._setups,
                                        log=self.log)
         # check fields inside the block, if the block isn't invisible
         if block.enabled:
             fields.extend(block._onlyfields)
     # always check fields not in a setup controlled group
     fields.extend(self._onlyfields)
     for field in fields:
         field.enabled = checkSetupSpec(field.setups, self._setups,
                                        log=self.log)
         if hasattr(field, '_namelabel'):
             field._namelabel.enabled = field.enabled
         if hasattr(field, '_valuelabel'):
             field._valuelabel.enabled = field.enabled
Beispiel #5
0
 def on_keyChange(self, key, value, time, expired):
     if key == 'session/mastersetup' and self.setupSpec:
         if not checkSetupSpec(self.setupSpec, value, log=self.log):
             self.close()
Beispiel #6
0
 def setSetups(self, setupSpec):
     self.setupSpec = setupSpec
     self.log.debug('setups are: %r', self.setupSpec)
     checkSetupSpec(self.setupSpec, '', log=self.log)
Beispiel #7
0
 def on_keyChange(self, key, value, time, expired):
     if key == 'session/mastersetup' and self.setupSpec:
         if hasattr(self, 'setWidgetVisible'):
             enabled = checkSetupSpec(self.setupSpec, value, log=self.log)
             self.setWidgetVisible.emit(self, enabled)
Beispiel #8
0
 def new_setups(self, setups):
     self.setup_enabled = checkSetupSpec(self.setup_expr, setups)
     self.expires_at = 0
Beispiel #9
0
 def on_keyChange(self, key, value, time, expired):
     if key == 'session/mastersetup' and self.setupSpec:
         self.setVisible(checkSetupSpec(self.setupSpec, value))