Skip to content

Commit

Permalink
Remove pi-buttons option
Browse files Browse the repository at this point in the history
  • Loading branch information
kasbah committed Jul 26, 2018
1 parent e44a8d4 commit 49449c1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 31 deletions.
3 changes: 0 additions & 3 deletions README.md
Expand Up @@ -19,9 +19,6 @@ Canute UI
optional arguments:
-h, --help show this help message and exit
--pi-buttons use evdev to process button presses more
directly(recommended for embedded usage on the
Raspberry Pi)
--debug debugging content
--text show text instead of braille
--tty TTY serial port for the display and button board
Expand Down
1 change: 0 additions & 1 deletion requirements-pi.txt
@@ -1,6 +1,5 @@
pyserial==2.7
frozendict==1.2
evdev==0.6.2
aioredux==1.1.0
async-timeout==2.0.0
aiofiles==0.3.2
Expand Down
9 changes: 0 additions & 9 deletions ui/argparser.py
Expand Up @@ -3,15 +3,6 @@

parser = argparse.ArgumentParser(description='Canute UI')

parser.add_argument(
'--pi-buttons',
action='store_const',
dest='pi_buttons',
const=True,
default=False,
help='use evdev to process button presses more directly '
+ '(recommended for embedded usage on the Raspberry Pi)'
)
parser.add_argument(
'--debug',
action='store_const',
Expand Down
4 changes: 2 additions & 2 deletions ui/driver/driver_both.py
Expand Up @@ -15,11 +15,11 @@


class DriverBoth():
def __init__(self, port='/dev/ttyACM0', pi_buttons=False,
def __init__(self, port='/dev/ttyACM0',
delay=0, display_text=False, timeout=60):
log.debug('__init__')
self.emulated = Emulated(delay, display_text)
self.pi = Pi(port, pi_buttons, timeout=timeout)
self.pi = Pi(port, timeout=timeout)
self.chars = 40
self.rows = 9

Expand Down
12 changes: 1 addition & 11 deletions ui/driver/driver_pi.py
Expand Up @@ -20,10 +20,9 @@ class Pi(Driver):
to it
:param port: the serial port the display is plugged into
:param pi_buttons: whether to use the evdev input for button presses
'''

def __init__(self, port=None, pi_buttons=False, timeout=60):
def __init__(self, port=None, timeout=60):
self.timeout = timeout
# get serial connection
if port is None:
Expand Down Expand Up @@ -165,12 +164,3 @@ def __enter__(self):


Driver.register(Pi)

if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)

pi = Pi(pi_buttons=True)
while 1:
buttons = pi.get_buttons()
log.info('buttons: %s' % buttons)
time.sleep(1)
8 changes: 3 additions & 5 deletions ui/main.py
Expand Up @@ -53,16 +53,14 @@ def main():
log.info('running with both emulated and real hardware on port %s'
% args.tty)
from .driver.driver_both import DriverBoth
with DriverBoth(port=args.tty, pi_buttons=args.pi_buttons,
delay=args.delay, display_text=args.text,
with DriverBoth(port=args.tty, delay=args.delay,
display_text=args.text,
timeout=timeout) as driver:
run(driver, config)
else:
log.info('running with real hardware on port %s, timeout %s' %
(args.tty, timeout))
with Pi(port=args.tty,
pi_buttons=args.pi_buttons,
timeout=timeout) as driver:
with Pi(port=args.tty, timeout=timeout) as driver:
run(driver, config)


Expand Down

0 comments on commit 49449c1

Please sign in to comment.