Skip to content

Commit df01852

Browse files
authored
Merge pull request #1 from basilfx/feature/modernize
Modernize repository and project
2 parents cde064b + 25fb21a commit df01852

File tree

14 files changed

+862
-362
lines changed

14 files changed

+862
-362
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 88

.gitignore

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
*.pyc
2-
*.pyo
3-
*.so
4-
*.coverage
5-
6-
build/
1+
__pycache__/
2+
.mypy_cache/
3+
.pytest_cache/
4+
.vscode/
75
dist/
8-
sdist/
6+
env/

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing
2+
To contribute to this repository, use GitHub pull-requests to contribute code
3+
to this repository.
4+
5+
A few things to pay attention to:
6+
7+
- Dependencies are managed using [poetry](https://python-poetry.org/).
8+
- Code is formatted using [Black](https://github.com/psf/black) and imports are
9+
sorted using [isort](https://pycqa.github.io/isort/).
10+
- Documentation conforms to the
11+
[Google Python Style Guide](https://google.github.io/styleguide/pyguide.html#doc-function-args).
12+
- Your branch is linear and logical.

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014-2015 Bas Stottelaar
1+
Copyright (c) 2014-2022 Bas Stottelaar
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Frame-based streaming protocol for embedded applications.
44
[![Build Status](https://travis-ci.org/basilfx/python-tinylink.svg?branch=master)](https://travis-ci.org/basilfx/python-tinylink)
55

66
## Introduction
7-
This is a general purpose Python module to provide a bi-directional frame-based streaming protocol for low-speed embedded applications, such as serial connected devices. It allowes the receiver to 'jump into' a stream of data frames. Every frame starts with a preamble, so the receiver can synchronize. Any mismatch in checksum will the receiver.
7+
This is a general purpose Python module to provide a bi-directional frame-based
8+
streaming protocol for low-speed embedded applications, such as serial
9+
connected devices. It allowes the receiver to 'jump into' a stream of data
10+
frames. Every frame starts with a preamble, so the receiver can synchronize.
811

912
A payload is optional.
1013

@@ -22,28 +25,40 @@ X = Body payload (max. 65536 bytes)
2225
Y = CRC32 checksum over header + body
2326
```
2427

25-
The flags field can have arbitrary values, but the following flags are reserved.
28+
The flags field can have arbitrary values, but the following flags are
29+
reserved.
2630

2731
* `0x01 = RESET`
2832
* `0x02 = ERROR`
2933
* `0x04 = PRIORITY`
3034

31-
Error correction is not implemented and the bytes are not aligned. The endianness is customizable.
35+
Error correction is not implemented and the bytes are not aligned. The
36+
endianness is customizable.
3237

3338
## State chart diagram
3439
Below is a simplified statechart diagram of the receiver.
3540
![Alt text](docs/statechart.png)
3641

3742
## Installation
38-
The latest development version can be installed via `pip install git+https://github.com/basilfx/python-tinylink`.
39-
40-
## Tests
41-
Tests can be executed with `nosetests`. Check the `tests/` folder for more information.
43+
The latest development version can be installed via
44+
`pip install git+https://github.com/basilfx/python-tinylink`.
4245

4346
## CLI
44-
A simple serial CLI is included. When installed, run `tinylink /dev/tty.PORT_HERE` to start it. You can use it to send raw bytes via the link and display what comes back.
47+
A simple serial CLI is included. When installed, run
48+
`tinylink /dev/tty.PORT_HERE` to start it. You can use it to send raw bytes via
49+
the link and display what comes back.
50+
51+
The CLI supports so-called modifiers to modify the outgoing data. For example,
52+
the input `\flags=1 hello world` would send a reset frame with the value
53+
'hello world'.
4554

4655
PySerial is required to run this CLI.
4756

57+
## Tests
58+
To run the tests, please clone this repository and run `poetry run pytest`.
59+
60+
## Contributing
61+
See the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
62+
4863
## License
49-
See the `LICENSE` file (MIT license).
64+
See the [`LICENSE.md`](LICENSE.md) file (MIT license).

0 commit comments

Comments
 (0)