Compare commits
4 commits
b7047bee4e
...
1abdb0cbd2
Author | SHA1 | Date | |
---|---|---|---|
|
1abdb0cbd2 | ||
|
2418a7cff9 | ||
|
2af7504c01 | ||
|
63217f6b16 |
6 changed files with 30 additions and 10 deletions
2
Makefile
2
Makefile
|
@ -1,5 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
export GO111MODULE=on
|
||||
|
||||
build:
|
||||
cd epson/faxmachine &&\
|
||||
go build -o ../library_bridge.so -buildmode=c-shared ../library_bridge.go
|
||||
|
|
14
app.py
14
app.py
|
@ -22,26 +22,26 @@ templates = {
|
|||
"DNH": {
|
||||
"text1": {
|
||||
"string": "Do Not Hack",
|
||||
"size": 50,
|
||||
"size": 130,
|
||||
"pos": 0
|
||||
},
|
||||
"text2": {
|
||||
"string": "bottom text",
|
||||
"size": 25,
|
||||
"pos": 55
|
||||
"size": 50,
|
||||
"pos": 130
|
||||
},
|
||||
"cut": True
|
||||
},
|
||||
"Food": {
|
||||
"text1": {
|
||||
"string": "Nickname",
|
||||
"size": 50,
|
||||
"size": 130,
|
||||
"pos": 0
|
||||
},
|
||||
"text2": {
|
||||
"string": "",
|
||||
"size": 25,
|
||||
"pos": 55
|
||||
"size": 50,
|
||||
"pos": 130
|
||||
},
|
||||
"cut": True
|
||||
}
|
||||
|
@ -206,5 +206,5 @@ def generated_file(filename):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
app.run(debug=False)
|
||||
|
||||
|
|
17
label_printer.service
Normal file
17
label_printer.service
Normal file
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Label printer webservice
|
||||
ConditionPathExists=/home/pi/label_printer
|
||||
After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pi
|
||||
Group=lp
|
||||
WorkingDirectory=/home/pi/label_printer
|
||||
ExecStart=sh -c "/bin/python3 app.py 2>&1 | tee /home/pi/log/labelprinter.log"
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=labelapi
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,3 +1,4 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
label_width = 100
|
||||
|
||||
label_width = 213
|
||||
printer_width = 512
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
{% if filename %}
|
||||
<br><br>
|
||||
<img src="user_data/{{filename}}" alt="Uploaded image">
|
||||
<img src="user_data/{{filename}}" alt="Uploaded image" style="height: 150px; width: auto;">
|
||||
|
||||
<form method="POST" action="/image-print">
|
||||
{% if cut %}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
{% if filename %}
|
||||
<br><br>
|
||||
<img src="user_data/{{filename}}" alt="Generated Image">
|
||||
<img src="user_data/{{filename}}" alt="Generated Image" style="height: 150px; width: auto;">
|
||||
|
||||
<form method="POST" action="/text-print">
|
||||
{% if cut %}
|
||||
|
|
Loading…
Reference in a new issue