]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/__init__.py
Agnostic now a package. Interactive testing now relies on monotonic. time now under...
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / __init__.py
index 0e52a3cf9a2b10317ca204d582d21b32541c40aa..08ec27e52ea151cd277c0c7092b92703a4e29092 100644 (file)
@@ -1,5 +1,6 @@
 """Module providing runtime utility objects to support the Micro/CircuitPython api"""
 
+
 class Enum(object):
     """
         Object supporting CircuitPython-style of static symbols
@@ -37,14 +38,15 @@ class ContextManaged:
     def __exit__(self, exc_type, exc_value, traceback):
         self.deinit()
 
-def Lockable(ContextManaged):
+
+class Lockable(ContextManaged):
     _locked = False
 
     def try_lock(self):
         if self._locked:
             return False
         else:
-            self._locked=True
+            self._locked = True
             return True
 
     def unlock(self):
@@ -52,3 +54,8 @@ def Lockable(ContextManaged):
             self._locked = False
         else:
             raise ValueError("Not locked")
+
+def patch_system():
+    import sys
+    from adafruit_blinka.agnostic import time
+    sys.modules['time'] = time
\ No newline at end of file