Skip to content

Instantly share code, notes, and snippets.

@OrangeTux
Created July 31, 2013 19:15
Show Gist options
  • Save OrangeTux/6125201 to your computer and use it in GitHub Desktop.
Save OrangeTux/6125201 to your computer and use it in GitHub Desktop.
""" adapters.py """
class PinAdapter:
def __init__(self, *args):
if(os.uname()[4][:3] != 'arm'):
return MockPin(*args)
else:
from ablib import Pin
return Pin(*args)
class MockPin:
def __init__(self, *args):
# some fake init
pass
def on(self):
pass
def off(self):
pass
""" scanner.py """
from adapters import PinAdapter
pin = PinAdapter('W', '14', 'hight')
pin.on()
pin.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment