changeset 4:e4d302bb0f38

Rename data member num_contacts to num_positions.
author Brian Neal <bgneal@gmail.com>
date Mon, 25 Nov 2013 20:43:29 -0600
parents 2528a106f1b5
children de0527b15cdf
files purple/switch.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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