littleprynter/src/web.py

30 lines
726 B
Python
Raw Normal View History

2022-03-12 04:29:51 +01:00
from flask import Flask, request
from printer import Printer
import time
import os
class Web(object):
2020-12-27 21:33:12 +01:00
"""docstring for web."""
2022-03-12 04:29:51 +01:00
def __init__(self, app, printer ):
super(Web).__init__()
self.printer = printer
self.app = app
def print_sms(self, texte, sign: str):
# TODO: verify the texte before printing it here ?
self.app.logger.debug("Printing : " + str(texte))
if not os.getenv('LIPY_DEBUG'):
time.sleep(10)
return self.printer.print_sms(texte, sign)
2020-12-27 21:33:12 +01:00
2022-03-12 04:29:51 +01:00
def print_image(self, image):
pass
def login(username: str,password: str) -> bool:
pass
2020-12-27 21:33:12 +01:00
2022-03-12 04:29:51 +01:00
def logout(username: str, password: str) -> bool:
pass