Feature/raspberry pi archive (#72)

* Converting OTP PDF generation to Latex to avoid installing wkhtmltopdf.

* Creating temporary_directory_path to simplify creating a TemporaryDirectory of type Path.

* Removing author

* Linting

* Installing texlive-latex-extra for more readable font.

* Raspberry pi has to archive locally.

Signed-off-by: Roland <roland@learningselfreliance.com>
This commit is contained in:
lrnselfreliance 2022-01-06 13:56:04 -07:00 • committed by Roland
parent d8f4d356bb
commit 6e55e7360b
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
10 changed files with 158 additions and 49 deletions

View file

@ -7,7 +7,7 @@ from sanic.request import Request
from wrolpi.root_api import get_blueprint
from wrolpi.schema import validate_doc
from .common import generate_html, generate_pdf, encrypt_otp, decrypt_otp
from .common import generate_pdf, encrypt_otp, decrypt_otp
from .schema import EncryptOTPRequest, DecryptOTPRequest
bp = get_blueprint('OTP', '/api/otp')
@ -33,11 +33,6 @@ async def post_decrypt_otp(_: Request, data: dict):
return response.json(data)
@bp.get('/html')
async def get_new_otp(_: Request):
return response.html(generate_html())
@bp.get('/pdf')
async def get_new_otp_pdf(_: Request):
random_name = ''.join(random.choice(ascii_letters) for _ in range(8))