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
06acbd71
Commit
06acbd71
authored
Jun 01, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use None in RPC server
parent
7f96ca82
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
rpc.py
printrun/rpc.py
+3
-3
No files found.
printrun/rpc.py
View file @
06acbd71
...
@@ -9,7 +9,7 @@ class ProntRPC(object):
...
@@ -9,7 +9,7 @@ class ProntRPC(object):
def
__init__
(
self
,
pronsole
,
port
=
RPC_PORT
):
def
__init__
(
self
,
pronsole
,
port
=
RPC_PORT
):
self
.
pronsole
=
pronsole
self
.
pronsole
=
pronsole
self
.
server
=
SimpleXMLRPCServer
((
"localhost"
,
port
))
self
.
server
=
SimpleXMLRPCServer
((
"localhost"
,
port
)
,
allow_none
=
True
)
self
.
server
.
register_function
(
self
.
get_status
,
'status'
)
self
.
server
.
register_function
(
self
.
get_status
,
'status'
)
self
.
thread
=
Thread
(
target
=
self
.
run_server
)
self
.
thread
=
Thread
(
target
=
self
.
run_server
)
self
.
thread
.
start
()
self
.
thread
.
start
()
...
@@ -26,11 +26,11 @@ class ProntRPC(object):
...
@@ -26,11 +26,11 @@ class ProntRPC(object):
progress
=
100
*
float
(
self
.
pronsole
.
p
.
queueindex
)
/
len
(
self
.
pronsole
.
p
.
mainqueue
)
progress
=
100
*
float
(
self
.
pronsole
.
p
.
queueindex
)
/
len
(
self
.
pronsole
.
p
.
mainqueue
)
elif
self
.
pronsole
.
sdprinting
:
elif
self
.
pronsole
.
sdprinting
:
progress
=
self
.
percentdone
progress
=
self
.
percentdone
else
:
progress
=
-
1
else
:
progress
=
None
if
self
.
pronsole
.
p
.
printing
or
self
.
pronsole
.
sdprinting
:
if
self
.
pronsole
.
p
.
printing
or
self
.
pronsole
.
sdprinting
:
eta
=
self
.
get_eta
()
eta
=
self
.
get_eta
()
else
:
else
:
eta
=
-
1
eta
=
None
return
{
"filename"
:
self
.
pronsole
.
filename
,
return
{
"filename"
:
self
.
pronsole
.
filename
,
"progress"
:
progress
,
"progress"
:
progress
,
"eta"
:
eta
,
"eta"
:
eta
,
...
...
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