Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alxwrd committed Aug 18, 2018
1 parent 9914cd5 commit 812b313
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
5 changes: 1 addition & 4 deletions l293d/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


class Config(object):
__verbose = True
__test_mode = False
Expand Down Expand Up @@ -33,10 +34,6 @@ def __setattr__(cls, attr, value):
raise AttributeError(
"object '{}' has no attribute '{}'".format(
cls.__name__, attr))
else:
# Now that the set_ method has done it's checks, we can use super()
# to actually set the value.
super(ConfigMeta, cls).__setattr__(attr, value)

@classmethod
def set_verbose(cls, value):
Expand Down
5 changes: 1 addition & 4 deletions l293d/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
threading = False
from time import sleep

from l293d.gpio import GPIO
from l293d.config import Config
Config = Config()

Expand All @@ -29,9 +30,6 @@ def v_print(string):
return False


# Import GPIO
from l293d.gpio import GPIO

GPIO.setwarnings(False)

# Set GPIO mode
Expand Down Expand Up @@ -236,4 +234,3 @@ def cleanup():
v_print('GPIO cleanup successful.')
except Exception:
v_print('GPIO cleanup failed.')

4 changes: 1 addition & 3 deletions l293d/gpio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from l293d.driver import v_print

raspberry_pi, micropython = True, True

try:
Expand All @@ -14,7 +12,7 @@
micropython = False

if not raspberry_pi and not micropython:
v_print(
print(
"Can't import a GPIO controller; test mode has been enabled:\n"
"http://l293d.rtfd.io/en/latest/user-guide/configuration/#test-mode")
from l293d.gpio.testgpio import GPIO
5 changes: 1 addition & 4 deletions l293d/gpio/micropython.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

import machine

from l293d.driver import v_print


class GPIO(object):
__pins = {}
Expand Down Expand Up @@ -30,7 +28,7 @@ def stop(self):
@classmethod
def PWM(cls, pin, freq):
return cls.PwmObject(cls.__pins[pin], freq)

@classmethod
def setwarnings(cls, warn):
pass
Expand All @@ -46,4 +44,3 @@ def setup(cls, pin_num, mode):
@classmethod
def output(cls, pin_num, mode):
cls.__pins[pin_num].value(mode)

5 changes: 1 addition & 4 deletions l293d/gpio/testgpio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

from l293d.driver import v_print


class GPIO(object):
__pins = {}
Expand All @@ -22,7 +20,7 @@ def start(self, duty):

def stop(self):
pass

@classmethod
def setwarnings(cls, warn):
pass
Expand All @@ -38,4 +36,3 @@ def setup(cls, pin_num, mode):
@classmethod
def output(cls, pin_num, mode):
pass

0 comments on commit 812b313

Please sign in to comment.