Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web2print
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Sauerburger
web2print
Commits
04559be8
Verified
Commit
04559be8
authored
5 years ago
by
Frank Sauerburger
Browse files
Options
Downloads
Patches
Plain Diff
Add asset handling
parent
ffd8d1f7
Branches
1-improve-user-interface
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web2print.py
+5
-1
5 additions, 1 deletion
web2print.py
with
5 additions
and
1 deletion
web2print.py
+
5
−
1
View file @
04559be8
...
...
@@ -2,7 +2,7 @@
import
os
from
time
import
time
import
cups
from
flask
import
Flask
,
render_template
,
request
from
flask
import
Flask
,
render_template
,
request
,
send_from_directory
from
werkzeug.utils
import
secure_filename
CUPS_SERVER
=
"
10.1.9.104:631
"
...
...
@@ -12,6 +12,10 @@ app = Flask(__name__)
app
.
config
[
'
UPLOAD_FOLDER
'
]
=
"
/tmp/web2print
"
os
.
makedirs
(
"
/tmp/web2print
"
,
exist_ok
=
True
)
@app.route
(
'
/assets/<string:resource>
'
)
def
assets
(
resource
):
return
send_from_directory
(
"
assets
"
,
resource
)
def
get_printers
():
conn
=
cups
.
Connection
()
return
list
(
conn
.
getPrinters
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment