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
a2e50a09
Commit
a2e50a09
authored
Aug 04, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Time display cleanup in pronterface.py
parent
df7622cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
pronterface.py
pronterface.py
+7
-4
No files found.
pronterface.py
View file @
a2e50a09
...
...
@@ -56,6 +56,9 @@ def dosify(name):
def
parse_temperature_report
(
report
,
key
):
return
float
(
filter
(
lambda
x
:
x
.
startswith
(
key
),
report
.
split
())[
0
]
.
split
(
":"
)[
1
]
.
split
(
"/"
)[
0
])
def
format_time
(
timestamp
):
return
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
localtime
(
timestamp
))
class
Tee
(
object
):
def
__init__
(
self
,
target
):
self
.
stdout
=
sys
.
stdout
...
...
@@ -176,18 +179,18 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def
startcb
(
self
):
self
.
starttime
=
time
.
time
()
print
"Print Started at: "
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
localtime
(
self
.
starttime
)
)
print
"Print Started at: "
+
format_time
(
self
.
starttime
)
def
endcb
(
self
):
if
(
self
.
p
.
queueindex
==
0
):
print
"Print ended at: "
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
localtime
(
time
.
time
()
))
print
"and took: "
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
)))
#+str(int(time.time()-self.starttime)/60)+" minutes "+str(int(time.time()-self.starttime)%60)+" seconds."
print
"Print ended at: "
+
format_time
(
time
.
time
(
))
print
"and took: "
+
format_time
(
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
))
wx
.
CallAfter
(
self
.
pausebtn
.
Disable
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
import
shlex
param
=
self
.
settings
.
final_command
pararray
=
[
i
.
replace
(
"$s"
,
str
(
self
.
filename
))
.
replace
(
"$t"
,
str
(
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
))
)))
.
encode
()
for
i
in
shlex
.
split
(
param
.
replace
(
"
\\
"
,
"
\\\\
"
)
.
encode
())]
pararray
=
[
i
.
replace
(
"$s"
,
str
(
self
.
filename
))
.
replace
(
"$t"
,
format_time
(
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
)))
.
encode
()
for
i
in
shlex
.
split
(
param
.
replace
(
"
\\
"
,
"
\\\\
"
)
.
encode
())]
self
.
finalp
=
subprocess
.
Popen
(
pararray
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
)
def
online
(
self
):
...
...
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