use ifacefmt function name consistently
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Mar 2018 21:10:28 +0000 (21:10 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Mar 2018 21:10:28 +0000 (21:10 +0000)
src/interface_decl.py

index 1ceb841fb7baa5fb89f0e9949bddb4965a62bee8..582d462e28aeb45e28405c42bc3de5e0701ec5cf 100644 (file)
@@ -17,7 +17,7 @@ class Pin(object):
         self.io = io
         self.action = action
 
-    def __str__(self):
+    def ifacefmt(self):
         res = '    '
         status = []
         if self.ready:
@@ -63,11 +63,8 @@ class Interface(object):
             else:
                 self.pins.append(Pin(**p))
 
-    def __str__(self):
-        return '\n'+'\n'.join(map(str, self.pins))
-
     def ifacefmt(self, i):
-        return str(self).format(i)
+        return '\n'+'\n'.join(map(lambda x:x.ifacefmt(), self.pins)).format(i)
 
 # basic test
 if __name__ == '__main__':