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
bdc2f9b1
Commit
bdc2f9b1
authored
Mar 27, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move parse_temperature_report to printrun_utils
parent
14cec4bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
printrun_utils.py
printrun/printrun_utils.py
+5
-0
pronterface.py
printrun/pronterface.py
+1
-6
No files found.
printrun/printrun_utils.py
View file @
bdc2f9b1
...
@@ -175,3 +175,8 @@ def hexcolor_to_float(color, components):
...
@@ -175,3 +175,8 @@ def hexcolor_to_float(color, components):
div
=
16
**
ndigits
-
1
div
=
16
**
ndigits
-
1
return
tuple
(
round
(
float
(
int
(
color
[
i
:
i
+
ndigits
],
16
))
/
div
,
2
)
return
tuple
(
round
(
float
(
int
(
color
[
i
:
i
+
ndigits
],
16
))
/
div
,
2
)
for
i
in
range
(
0
,
numel
,
ndigits
))
for
i
in
range
(
0
,
numel
,
ndigits
))
tempreport_exp
=
re
.
compile
(
"([TB]
\
d*):([-+]?
\
d*
\
.?
\
d*)(?: ?
\
/)?([-+]?
\
d*
\
.?
\
d*)"
)
def
parse_temperature_report
(
report
):
matches
=
tempreport_exp
.
findall
(
report
)
return
dict
((
m
[
0
],
(
m
[
1
],
m
[
2
]))
for
m
in
matches
)
printrun/pronterface.py
View file @
bdc2f9b1
...
@@ -35,7 +35,7 @@ from . import pronsole
...
@@ -35,7 +35,7 @@ from . import pronsole
from
.
import
printcore
from
.
import
printcore
from
printrun.printrun_utils
import
install_locale
,
setup_logging
,
\
from
printrun.printrun_utils
import
install_locale
,
setup_logging
,
\
hexcolor_to_float
hexcolor_to_float
,
parse_temperature_report
install_locale
(
'pronterface'
)
install_locale
(
'pronterface'
)
try
:
try
:
...
@@ -59,13 +59,8 @@ from printrun.excluder import Excluder
...
@@ -59,13 +59,8 @@ from printrun.excluder import Excluder
from
pronsole
import
dosify
,
wxSetting
,
HiddenSetting
,
StringSetting
,
SpinSetting
,
FloatSpinSetting
,
BooleanSetting
,
StaticTextSetting
from
pronsole
import
dosify
,
wxSetting
,
HiddenSetting
,
StringSetting
,
SpinSetting
,
FloatSpinSetting
,
BooleanSetting
,
StaticTextSetting
from
printrun
import
gcoder
from
printrun
import
gcoder
tempreport_exp
=
re
.
compile
(
"([TB]
\
d*):([-+]?
\
d*
\
.?
\
d*)(?: ?
\
/)?([-+]?
\
d*
\
.?
\
d*)"
)
tempreading_exp
=
re
.
compile
(
"(^T:| T:)"
)
tempreading_exp
=
re
.
compile
(
"(^T:| T:)"
)
def
parse_temperature_report
(
report
):
matches
=
tempreport_exp
.
findall
(
report
)
return
dict
((
m
[
0
],
(
m
[
1
],
m
[
2
]))
for
m
in
matches
)
class
Tee
(
object
):
class
Tee
(
object
):
def
__init__
(
self
,
target
):
def
__init__
(
self
,
target
):
self
.
stdout
=
sys
.
stdout
self
.
stdout
=
sys
.
stdout
...
...
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