Compare commits

..

2 Commits

Author SHA1 Message Date
Michael Iseli
bf96148461 Add python virtual env instructions
This change adds instructions on how to setup a python virtual env for this
repo.
In addition, the respective requirements files have been added for easy
installation with pip.
2022-01-06 20:47:57 +01:00
Jeroen Lodder
5dc155f556 Use print_ascii to make it work in powershell
qr.print_tty() doesn't work on windows, but qr.print_ascii() does.

May look a bit less formatted, but can still be scanned
2021-12-31 13:30:22 +01:00
5 changed files with 20 additions and 1 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
generated_python/__pycache__/
qr/
venv/

View File

@@ -28,6 +28,18 @@ For printing QR codes, the qrcode module is required
pip install qrcode[pil]
### Alternative installation method
Alternatively, you can use a python virtual env for the dependencies:
python -m venv venv
. venv/bin/activate
pip install -r requirements-buildenv.txt
pip install -r requirements.txt
The requirements\*.txt files contain all the dependencies (also the optional ones).
To leave the python virtual env just call `deactivate`.
## Technical background
The export QR code of "Google Authenticator" contains the URL `otpauth-migration://offline?data=...`.

View File

@@ -78,7 +78,7 @@ def save_qr(data, name):
def print_qr(data):
qr = QRCode()
qr.add_data(data)
qr.print_tty()
qr.print_ascii()
i = j = 0
for line in (line.strip() for line in fileinput.input(args.infile)):

View File

@@ -0,0 +1 @@
wheel

3
requirements.txt Normal file
View File

@@ -0,0 +1,3 @@
protobuf
qrcode
Pillow