Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Johan Bloemberg
committed
Nov 14, 2016
1 parent
135eef2
commit 40f138e
Showing
5 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
layout python3 | ||
python setup.py develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,45 @@ | ||
"""Command line interface for rflink library.""" | ||
"""Command line interface for rflink library. | ||
Usage: | ||
rflink [--port=<port>, --baud=<baud>] | ||
rflink (-h | --help) | ||
rflink --version | ||
Options: | ||
-p --port=<port> Serial port to connect to [default: /dev/ttyACM0]. | ||
--baud=<baud> Serial baud rate [default: 57600]. | ||
-h --help Show this screen. | ||
--version Show version. | ||
""" | ||
|
||
import asyncio | ||
|
||
import pkg_resources | ||
from docopt import docopt | ||
|
||
|
||
@asyncio.coroutine | ||
def output(): | ||
"""Provide output to console.""" | ||
import itertools | ||
counter = itertools.count() | ||
while True: | ||
print(next(counter)) | ||
yield from asyncio.sleep(1) | ||
|
||
|
||
def main(): | ||
"""Parse argument and setup main program loop.""" | ||
pass | ||
arguments = docopt(__doc__, version=pkg_resources.require('rflink')[0].version) | ||
print(arguments) | ||
loop = asyncio.get_event_loop() | ||
tasks = asyncio.gather(output()) | ||
try: | ||
loop.run_until_complete(tasks) | ||
except KeyboardInterrupt: | ||
tasks.cancel() | ||
loop.run_forever() | ||
tasks.exception() | ||
finally: | ||
loop.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[pylama] | ||
linters = pydocstyle,pycodestyle,pyflakes,mccabe | ||
linters = pydocstyle,pycodestyle,pyflakes,mccabe,isort | ||
ignore = D213 | ||
|
||
[pylama:pycodestyle] | ||
max-line-length = 100 | ||
max_line_length = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,6 @@ usedevelop = True | |
|
||
[testenv:lint] | ||
commands = pylama setup.py rflink tests | ||
deps = pylama | ||
deps = | ||
pylama | ||
isort |