exopy.measurement.monitors.text_monitor.rules.base module

Rules allow to defines some automatic handling of database entries in the TextMonitor.

class exopy.measurement.monitors.text_monitor.rules.base.BaseRule[source]

Bases: exopy.utils.atom_util.HasPrefAtom

Base class for all rules implementations.

id

Name of the rule.

description

Quick description of what this rule is intended for.

suffixes

List of database entries suffixes used to identify the entries which contributes to the rule.

class_id

Id of the class used for persistence.

try_apply(new_entry, monitor)[source]

Attempt to apply the rule.

Parameters
  • new_entry (str) – Database path of the newly added entry.

  • monitor (TextMonitor) – Instance of the text monitor trying to apply the rule.

class exopy.measurement.monitors.text_monitor.rules.base.Rules(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.GroupDeclarator

Declarator used to group rules declarations.

class exopy.measurement.monitors.text_monitor.rules.base.RuleType(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.Declarator

Declarator used to contribute a text monitor rule.

rule

Path to the rule object. Path should be dot separated and the class name preceded by ‘:’. ex: exopy.measurement.monitors.text_monitor.std_rules:RejectRule The path of any parent GroupDeclarator object will be prepended to it.

view

Path to the view object associated with the task. The path of any parent GroupDeclarator object will be prepended to it.

register(collector, traceback)[source]

Collect rule and view and store them into the DeclaratorCollector contributions member.

The group declared by a parent if any is taken into account.

unregister(collector)[source]

Remove contributed infos from the collector.

class exopy.measurement.monitors.text_monitor.rules.base.RuleConfig(parent=None, **kwargs)[source]

Bases: enaml.core.declarative.Declarative

Object to contribute a concrete rule.

This rule will only be used if no user defined rule with the same name is defined.

id

Id of this rule configuration this should be unique.

description

Quick description of what this rule is intended for.

rule_type

Id of the rule to use. This is dot separated string containing the name of the package defining the rule type and the rule type name.

config

Configuration dictionary to use to instantiate the rule