isascii for py3.6 (#623)

* homebrew isascii for py3.6

* get back support of python 3.6
This commit is contained in:
Stepan Snigirev 2020-11-19 22:13:44 +01:00 committed by GitHub
parent d905a0408a
commit 320bd6a98d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -68,7 +68,7 @@ The easiest way to run Specter Desktop is by installing the Specter Desktop app,
With this method, all you need to do is just download the right file for your operating system and install it like a normal desktop app.
### Installing Specter from Pip
* Specter requires version 3.7 or 3.8
* Specter requires Python version 3.6 to 3.8. We will support python 3.9 when HWI adds support for it.
* HWI support requires `libusb`
* Ubuntu/Debian: `sudo apt install libusb-1.0-0-dev libudev-dev`
* macOS: `brew install libusb`

View file

@ -37,5 +37,5 @@ setup(
"Operating System :: OS Independent",
"Framework :: Flask",
],
python_requires=">=3.7,<3.9",
python_requires=">=3.6,<3.9",
)

View file

@ -46,7 +46,9 @@ def to_ascii20(name: str) -> str:
"""
Converts the name to max 20 ascii-only characters.
"""
return "".join([c for c in name if c.isascii()])[:20]
# ascii characters have codes from 0 to 127
# but 127 is "delete" and we don't want it
return "".join([c for c in name if ord(c) < 127])[:20]
def alias(name):