# HG changeset patch # User Brian Neal # Date 1385433809 21600 # Node ID e4d302bb0f38c57f0f396811148562946573131f # Parent 2528a106f1b59769d004cd09a1c778925f7a1b5e Rename data member num_contacts to num_positions. diff -r 2528a106f1b5 -r e4d302bb0f38 purple/switch.py --- a/purple/switch.py Mon Nov 25 20:31:12 2013 -0600 +++ b/purple/switch.py Mon Nov 25 20:43:29 2013 -0600 @@ -24,19 +24,19 @@ """ self.wiring = wiring - self.num_contacts = len(wiring) + self.num_positions = len(wiring) self.num_levels = len(wiring[0]) self.pos = init_pos if not all(self.num_levels == len(level) for level in wiring): raise SteppingSwitchError("Ragged wiring table") - if not (0 <= self.pos < self.num_contacts): + if not (0 <= self.pos < self.num_positions): raise SteppingSwitchError("Illegal initial position") def step(self): """Advance the stepping switch position.""" - self.pos = (self.pos + 1) % self.num_contacts + self.pos = (self.pos + 1) % self.num_positions def __getitem__(self, level): """This method is how to determine the output signal from the stepping