Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
0d13fd91
Commit
0d13fd91
authored
May 06, 2013
by
D1plo1d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chaging original_file_name => file_name in pronserve. Fixing the pause between print jobs options
parent
57c19bd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
printserve.py
printserve.py
+10
-9
No files found.
printserve.py
View file @
0d13fd91
...
@@ -95,6 +95,7 @@ class JobsHandler(tornado.web.RequestHandler):
...
@@ -95,6 +95,7 @@ class JobsHandler(tornado.web.RequestHandler):
def
post
(
self
):
def
post
(
self
):
fileinfo
=
self
.
request
.
files
[
'job'
][
0
]
fileinfo
=
self
.
request
.
files
[
'job'
][
0
]
printserve
.
do_add_job
(
fileinfo
[
'filename'
],
fileinfo
[
'body'
])
printserve
.
do_add_job
(
fileinfo
[
'filename'
],
fileinfo
[
'body'
])
self
.
finish
(
"ACK"
)
self
.
finish
(
"ACK"
)
class
JobHandler
(
tornado
.
web
.
RequestHandler
):
class
JobHandler
(
tornado
.
web
.
RequestHandler
):
...
@@ -359,12 +360,12 @@ class Printserve(pronsole.pronsole, EventEmitter):
...
@@ -359,12 +360,12 @@ class Printserve(pronsole.pronsole, EventEmitter):
self
.
update_job_progress
(
100
)
self
.
update_job_progress
(
100
)
self
.
fire
(
"job_finished"
,
self
.
jobs
.
sanitize
(
self
.
current_job
))
self
.
fire
(
"job_finished"
,
self
.
jobs
.
sanitize
(
self
.
current_job
))
if
self
.
settings
.
pause_between_prints
:
if
self
.
settings
.
pause_between_prints
and
self
.
current_job
!=
None
:
print
"Print job complete. Pausing between jobs."
print
"Print job complete. Pausing between jobs."
self
.
current_job
=
None
self
.
current_job
=
None
self
.
printing_jobs
=
False
self
.
printing_jobs
=
False
elif
len
(
self
.
jobs
.
list
)
>
0
:
elif
len
(
self
.
jobs
.
list
)
>
0
:
print
"
Print job complete.
Starting the next print job"
print
"Starting the next print job"
self
.
current_job
=
self
.
jobs
.
list
.
pop
(
0
)
self
.
current_job
=
self
.
jobs
.
list
.
pop
(
0
)
self
.
p
.
startprint
(
self
.
current_job
[
'body'
]
.
split
(
"
\n
"
))
self
.
p
.
startprint
(
self
.
current_job
[
'body'
]
.
split
(
"
\n
"
))
self
.
fire
(
"job_started"
,
self
.
jobs
.
sanitize
(
self
.
current_job
))
self
.
fire
(
"job_started"
,
self
.
jobs
.
sanitize
(
self
.
current_job
))
...
@@ -460,26 +461,26 @@ class PrintJobQueue(EventEmitter):
...
@@ -460,26 +461,26 @@ class PrintJobQueue(EventEmitter):
def
sanitize
(
self
,
job
):
def
sanitize
(
self
,
job
):
return
dict
(
return
dict
(
id
=
job
[
"id"
],
id
=
job
[
"id"
],
file_name
=
job
[
"
original_
file_name"
],
file_name
=
job
[
"file_name"
],
)
)
def
add
(
self
,
original_
file_name
,
body
):
def
add
(
self
,
file_name
,
body
):
ext
=
os
.
path
.
splitext
(
original_
file_name
)[
1
]
ext
=
os
.
path
.
splitext
(
file_name
)[
1
]
job
=
dict
(
job
=
dict
(
id
=
self
.
__last_id
,
id
=
self
.
__last_id
,
original_file_name
=
original_
file_name
,
file_name
=
file_name
,
body
=
body
,
body
=
body
,
)
)
self
.
__last_id
+=
1
self
.
__last_id
+=
1
self
.
list
.
append
(
job
)
self
.
list
.
append
(
job
)
print
"Added
%
s"
%
(
original_
file_name
)
print
"Added
%
s"
%
(
file_name
)
self
.
fire
(
"job_added"
,
job
)
self
.
fire
(
"job_added"
,
job
)
def
display_summary
(
self
):
def
display_summary
(
self
):
print
"Print Jobs:"
print
"Print Jobs:"
for
job
in
self
.
list
:
for
job
in
self
.
list
:
print
"
%
i:
%
s"
%
(
job
[
'id'
],
job
[
'
original_
file_name'
])
print
"
%
i:
%
s"
%
(
job
[
'id'
],
job
[
'file_name'
])
print
""
print
""
return
True
return
True
...
@@ -502,7 +503,7 @@ class PrintJobQueue(EventEmitter):
...
@@ -502,7 +503,7 @@ class PrintJobQueue(EventEmitter):
self
.
list
.
remove
(
job
)
self
.
list
.
remove
(
job
)
self
.
list
.
insert
(
position
,
job
)
self
.
list
.
insert
(
position
,
job
)
print
int
(
job_attrs
[
'position'
])
print
int
(
job_attrs
[
'position'
])
print
"Print #
%
s Job Updated (
%
s )."
%
(
job
[
'id'
],
job
[
'
original_
file_name'
])
print
"Print #
%
s Job Updated (
%
s )."
%
(
job
[
'id'
],
job
[
'file_name'
])
self
.
fire
(
"job_updated"
,
job
)
self
.
fire
(
"job_updated"
,
job
)
def
find_by_id
(
self
,
job_id
):
def
find_by_id
(
self
,
job_id
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment