]> Repositories - hackapet/Adafruit_Blinka.git/blobdiff - python/mcp/__init__.py
Moved Pin definition back so that __module__ properly rendered by repr(). Fear of...
[hackapet/Adafruit_Blinka.git] / python / mcp / __init__.py
index a8c4a84f5146dac324115ba420d9e55958ec7aba..2ee42c22601ca91c6d0b6c24ecb6fe9fecfef95a 100644 (file)
@@ -6,18 +6,6 @@ class Enum(object):
         as seen with Direction.OUTPUT, Pull.UP
     """
 
-    @classmethod
-    def iteritems(cls):
-        """
-            Inspects attributes of the class for instances of the class
-            and returns as key,value pairs mirroring dict#iteritems
-        """
-        for key in dir(cls):
-            val = getattr(cls, key)
-            if type(val) is cls:
-                yield (key, val)
-
-
     def __repr__(self):
         """
         Assumes instance will be found as attribute of own class.
@@ -30,8 +18,15 @@ class Enum(object):
                 return "{}.{}.{}".format(cls.__module__, cls.__qualname__, key)
         return repr(self)
 
-class Pin(Enum):
-    def __init__(self, id):
-        """ id type is likely platform-specific"""
-        self.id = id
-    pass
+    @classmethod
+    def iteritems(cls):
+        """
+            Inspects attributes of the class for instances of the class
+            and returns as key,value pairs mirroring dict#iteritems
+        """
+        for key in dir(cls):
+            val = getattr(cls, key)
+            if type(val) is cls:
+                yield (key, val)
+
+