From: W. Trevor King Date: Mon, 26 Mar 2012 16:35:05 +0000 (-0400) Subject: Use a dummy write function for Stepper until we've initialized from the config. X-Git-Tag: v0.4~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4646998ec16d8753bd3ba3171420ee697027cca2;p=pyafm.git Use a dummy write function for Stepper until we've initialized from the config. --- diff --git a/pyafm/stepper.py b/pyafm/stepper.py index 3c04556..6683484 100644 --- a/pyafm/stepper.py +++ b/pyafm/stepper.py @@ -38,17 +38,17 @@ class Stepper(_stepper.Stepper): self.config = config self.port = None c = self.config # reduce verbosity + dummy_write = lambda value: None super(Stepper, self).__init__( - write=self.port.write_bitfield, full_step=c['full-step'], - logic=c['logic'], delay=c['delay'], step_size=c['step-size'], - backlash=c['backlash']) + write=dummy_write, full_step=c['full-step'], logic=c['logic'], + delay=c['delay'], step_size=c['step-size'], backlash=c['backlash']) def load_from_config(self, devices): c = self.config # reduce verbosity if self.port is None: self.port = _DigitalPort(config=c['port']) self.port.load_from_config(devices=devices) - self._write = self.port.write_bitfield + self._write = self.port.write_bitfield self.full_step = c['full-step'] self.logic = c['logic'] self.delay = c['delay']