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
aac2b605
Commit
aac2b605
authored
Jun 01, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't log requests and add tempreadings to rpc status report
parent
dc4564d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
rpc.py
printrun/rpc.py
+10
-1
No files found.
printrun/rpc.py
View file @
aac2b605
from
SimpleXMLRPCServer
import
SimpleXMLRPCServer
from
SimpleXMLRPCServer
import
SimpleXMLRPCServer
from
threading
import
Thread
from
threading
import
Thread
from
.utils
import
parse_temperature_report
RPC_PORT
=
7978
RPC_PORT
=
7978
class
ProntRPC
(
object
):
class
ProntRPC
(
object
):
...
@@ -9,7 +11,9 @@ class ProntRPC(object):
...
@@ -9,7 +11,9 @@ 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
),
allow_none
=
True
)
self
.
server
=
SimpleXMLRPCServer
((
"localhost"
,
port
),
allow_none
=
True
,
logRequests
=
False
)
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
()
...
@@ -31,7 +35,12 @@ class ProntRPC(object):
...
@@ -31,7 +35,12 @@ class ProntRPC(object):
eta
=
self
.
get_eta
()
eta
=
self
.
get_eta
()
else
:
else
:
eta
=
None
eta
=
None
if
self
.
pronsole
.
tempreadings
:
temps
=
parse_temperature_report
(
self
.
pronsole
.
tempreadings
)
else
:
temps
=
None
return
{
"filename"
:
self
.
pronsole
.
filename
,
return
{
"filename"
:
self
.
pronsole
.
filename
,
"progress"
:
progress
,
"progress"
:
progress
,
"eta"
:
eta
,
"eta"
:
eta
,
"temps"
:
temps
,
}
}
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