Home | History | Annotate | Download | only in wardmodem

Lines Matching refs:component

18     To declare a new state component called dummy_var, with allowed values
25 use the state component, viz,
35 # A map to record the allowed values for each state component.
40 # This value can be assigned to any state component to indicate invalid
42 # This is also the default value assigned when the state component is
47 def __getitem__(self, component):
49 Read current value of a state component.
51 @param component: The component of interest.
53 @return: String value of the state component.
55 @raises: StateMachineException if the component does not exist.
58 if component not in self._values:
59 self._runtime_error('Attempted to read value of unknown component: '
60 '|%s|' % component)
61 return self._values[component]
64 def __setitem__(self, component, value):
66 Write a new value to the specified state component.
68 @param component: The component of interest.
70 @param value: String value of the state component
72 @raises: StateMachineException if the component does not exist, or if
73 the value provided is not a valid value for the component.
76 if component not in self._values:
77 self._runtime_error('Attempted to write value to unknown component:'
78 ' |%s|' % component)
79 if value not in self._allowed_values[component]:
81 'component |%s|. Valid values are %s.' %
82 (value, component,
83 str(self._allowed_values[component])))
85 component, self._values[component], value)
86 self._values[component] = value
111 Add a state component to the global state.
113 @param component_name: The name of the newly created state component.
114 Component names must be unique. Use lower case names.
129 # Add component.
132 self._setup_error('Component name ill-formed: |%s|' %
135 self._setup_error('Component already exists: |%s|' % component_name)