]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/__init__.py
Massive pylinting session and added Github Actions
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / __init__.py
index 8c83305655eae82d331535544741115961743efa..2df8a2d702228cd493a493da985788753c47081c 100755 (executable)
@@ -1,7 +1,12 @@
-"""Module providing runtime utility objects to support the Micro/CircuitPython api"""
+"""
+`adafruit_blinka` - Runtime utility objects for re-implementation of CircuitPython API
+======================================================================================
 
+* Author(s): cefn
+"""
 
-class Enum(object):
+
+class Enum:
     """
         Object supporting CircuitPython-style of static symbols
         as seen with Direction.OUTPUT, Pull.UP
@@ -33,19 +38,24 @@ class Enum(object):
 
 class ContextManaged:
     """An object that automatically deinitializes hardware with a context manager."""
+
     def __enter__(self):
         return self
 
     def __exit__(self, exc_type, exc_value, traceback):
         self.deinit()
 
+    # pylint: disable=no-self-use
     def deinit(self):
         """Free any hardware used by the object."""
-        pass
+        return
+
+    # pylint: enable=no-self-use
 
 
 class Lockable(ContextManaged):
     """An object that must be locked to prevent collisions on a microcontroller resource."""
+
     _locked = False
 
     def try_lock(self):
@@ -62,8 +72,13 @@ class Lockable(ContextManaged):
         else:
             raise ValueError("Not locked")
 
+
 def patch_system():
     """Patch modules that may be different due to the platform."""
+    # pylint: disable=import-outside-toplevel
     import sys
     from adafruit_blinka.agnostic import time
-    sys.modules['time'] = time
+
+    # pylint: enable=import-outside-toplevel
+
+    sys.modules["time"] = time