Clean up repeated string substitutions

This commit is contained in:
Dave Jones
2016-10-21 11:07:48 +01:00
parent 4d79dc74db
commit c570b8f09b
5 changed files with 15 additions and 15 deletions

View File

@@ -192,14 +192,14 @@ class PiPin(Pin):
"""
def __init__(self, factory, number):
super(PiPin, self).__init__()
self._factory = weakref.proxy(factory)
self._number = number
try:
factory.pi_info.physical_pin('GPIO%d' % number)
factory.pi_info.physical_pin(self.address[-1])
except PinNoPins:
warnings.warn(
PinNonPhysical(
'no physical pins exist for GPIO%d' % number))
self._factory = weakref.proxy(factory)
self._number = number
'no physical pins exist for %s' % self.address[-1]))
@property
def number(self):