manouevring around the proxy pass errors, including the index file in the flask application now
This commit is contained in:
parent
f163337313
commit
73b0f9310f
@ -44,7 +44,11 @@ def check():
|
|||||||
already_in_db = televex.update_db(db, db_path, txt, source, date)
|
already_in_db = televex.update_db(db, db_path, txt, source, date)
|
||||||
if already_in_db == False:
|
if already_in_db == False:
|
||||||
televex.print_now(txt, lp=lp, type='rss')
|
televex.print_now(txt, lp=lp, type='rss')
|
||||||
|
|
||||||
|
@APP.route('/', methods=['GET'])
|
||||||
|
def index():
|
||||||
|
return flask.render_template('index.html')
|
||||||
|
|
||||||
@APP.route('/print/', methods=['GET', 'POST'])
|
@APP.route('/print/', methods=['GET', 'POST'])
|
||||||
def print():
|
def print():
|
||||||
txt = request.args.get('printing', '')
|
txt = request.args.get('printing', '')
|
||||||
|
@ -20,4 +20,4 @@ div.msg pre{
|
|||||||
width: 400px;
|
width: 400px;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
BIN
print/static/televex-feb-2021.jpg
Normal file
BIN
print/static/televex-feb-2021.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 261 KiB |
12
print/templates/index.html
Normal file
12
print/templates/index.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang='en'>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>TeleVex</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='stylesheet.css')}}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>TeleVex</h1>
|
||||||
|
<img src="{{ url_for('static', filename='televex-feb-2021.jpg')}}" width="400px" height="auto">
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -10,7 +10,7 @@ def connect():
|
|||||||
# Get the printer's USB initializing code with $ sudo lsbusb
|
# Get the printer's USB initializing code with $ sudo lsbusb
|
||||||
try:
|
try:
|
||||||
lp = printer.Usb(0x4b8,0xe15) # televex printer @ Varia
|
lp = printer.Usb(0x4b8,0xe15) # televex printer @ Varia
|
||||||
# lp = printer.Usb(0x4b8,0xe03) # printer @ poel
|
lp = printer.Usb(0x4b8,0xe03) # printer @ poel
|
||||||
except:
|
except:
|
||||||
lp = None
|
lp = None
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ def database(db_path):
|
|||||||
return db
|
return db
|
||||||
|
|
||||||
def html2plain(html):
|
def html2plain(html):
|
||||||
# remove HTML tags
|
# remove HTML tags
|
||||||
txt = re.sub(r'<.*?>', '', html)
|
txt = re.sub(r'<.*?>', '', html)
|
||||||
|
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
def preprocess(output, type=None):
|
def preprocess(output, type=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user