Example #1
0
    def _scalers_changed(self, *args):
        shell = self.shell
        new_scalers = [scaler for scaler in self.scalers
                       if scaler
                       not in shell.user_ns]

        for scaler in new_scalers:
            dev = self._get_device(scaler)
            if dev is not None and util.is_valid_python_identifier(scaler):
                shell.user_ns[scaler] = dev
Example #2
0
    def _motor_list_changed(self, *args):
        shell = self.shell
        new_motors = [motor for motor in self.motor_list
                      if motor not in shell.user_ns]

        for motor in new_motors:
            try:
                expanded = util.expand_alias(motor)
                motor_inst = epics.Motor(expanded)
            except Exception as ex:
                logger.error('Bad motor: %s (%s) %s'
                             % (motor, ex.__class__.__name__, ex))
            except KeyboardInterrupt:
                logger.warning('Skipping motor list entry: %s' % motor)
            else:
                self.motors[motor] = motor_inst

                if util.is_valid_python_identifier(motor):
                    shell.user_ns[motor] = motor_inst