### semantics may be that the services are all assigned the /same/ random
### password.)
+###--------------------------------------------------------------------------
+### Some utilities.
+
+OPS = ['set', 'reset', 'clear']
+## A list of the available operations.
+
+class polswitch (U.struct):
+ """A small structure holding a value for each operation."""
+ __slots__ = OPS
+
###--------------------------------------------------------------------------
### Operation protocol.
###--------------------------------------------------------------------------
### Master policy switch.
-class polswitch (U.struct):
- __slots__ = ['set', 'reset', 'clear']
-
CONF.DEFAULTS.update(
## Map a request type `set', `reset', or `clear', to the appropriate
## request class.
- RQCLASS = polswitch(None, None, None),
+ RQCLASS = polswitch(**dict((i, None) for i in OPS)),
## Alternatively, set this to a mixin class to apply common policy to all
## the kinds of requests.