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
4a5e13f2
Commit
4a5e13f2
authored
Aug 20, 2012
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch errors when appending text to logbox
parent
e73e11d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
pronterface.py
pronterface.py
+13
-9
No files found.
pronterface.py
View file @
4a5e13f2
...
...
@@ -390,9 +390,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
capture_skip
[
pat
]
-=
1
self
.
capture_skip_newline
=
True
return
wx
.
CallAfter
(
self
.
logbox
.
AppendText
,
l
)
if
webavail
:
self
.
webInterface
.
AppendLog
(
l
)
wx
.
CallAfter
(
self
.
addtexttolog
,
l
);
def
scanserial
(
self
):
"""scan for available ports. return a list of device names."""
...
...
@@ -1304,15 +1302,21 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
else
:
wx
.
CallAfter
(
self
.
graph
.
StopPlotting
)
def
addtexttolog
(
self
,
text
):
try
:
self
.
logbox
.
AppendText
(
text
)
except
:
print
"attempted to write invalid text to console"
pass
if
webavail
:
self
.
webInterface
.
AppendLog
(
text
)
def
sendline
(
self
,
e
):
command
=
self
.
commandbox
.
GetValue
()
if
not
len
(
command
):
return
wx
.
CallAfter
(
self
.
logbox
.
AppendText
,
">>>"
+
command
+
"
\n
"
)
if
webavail
:
self
.
webInterface
.
AppendLog
(
">>>"
+
command
+
"
\n
"
)
wx
.
CallAfter
(
self
.
addtexttolog
,
">>>"
+
command
+
"
\n
"
);
self
.
onecmd
(
str
(
command
))
self
.
commandbox
.
SetSelection
(
0
,
len
(
command
))
self
.
commandbox
.
history
+=
[
command
]
...
...
@@ -1408,7 +1412,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
(
tstring
!=
"ok"
)
and
(
tstring
!=
"wait"
)
and
(
"ok T:"
not
in
tstring
):
# print "*"+tstring+"*"
# print "[" + time.strftime('%H:%M:%S',time.localtime(time.time())) + "] " + tstring
wx
.
CallAfter
(
self
.
logbox
.
AppendText
,
tstring
+
"
\n
"
)
wx
.
CallAfter
(
self
.
addtexttolog
,
tstring
+
"
\n
"
);
for
i
in
self
.
recvlisteners
:
i
(
l
)
...
...
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