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
71e5da00
Commit
71e5da00
authored
Jan 23, 2013
by
kliment
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #318 from hroncok/master
Show connection error to the user
parents
5897fbc6
354bfb09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
pronterface.py
pronterface.py
+19
-2
No files found.
pronterface.py
View file @
71e5da00
...
@@ -28,6 +28,7 @@ except:
...
@@ -28,6 +28,7 @@ except:
import
sys
,
glob
,
time
,
datetime
,
threading
,
traceback
,
cStringIO
,
subprocess
import
sys
,
glob
,
time
,
datetime
,
threading
,
traceback
,
cStringIO
,
subprocess
from
printrun.pronterface_widgets
import
*
from
printrun.pronterface_widgets
import
*
from
serial
import
SerialException
StringIO
=
cStringIO
StringIO
=
cStringIO
...
@@ -72,7 +73,11 @@ class Tee(object):
...
@@ -72,7 +73,11 @@ class Tee(object):
self
.
target
(
data
)
self
.
target
(
data
)
except
:
except
:
pass
pass
self
.
stdout
.
write
(
data
.
encode
(
"utf-8"
))
try
:
data
=
data
.
encode
(
"utf-8"
)
except
:
pass
self
.
stdout
.
write
(
data
)
def
flush
(
self
):
def
flush
(
self
):
self
.
stdout
.
flush
()
self
.
stdout
.
flush
()
...
@@ -1420,7 +1425,19 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -1420,7 +1425,19 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
paused
=
0
self
.
paused
=
0
if
self
.
sdprinting
:
if
self
.
sdprinting
:
self
.
p
.
send_now
(
"M26 S0"
)
self
.
p
.
send_now
(
"M26 S0"
)
self
.
p
.
connect
(
port
,
baud
)
try
:
self
.
p
.
connect
(
port
,
baud
)
except
SerialException
as
e
:
# Currently, there is no errno, but it should be there in the future
if
e
.
errno
==
2
:
print
_
(
"Error: You are trying to connect to a non-exisiting port."
)
elif
e
.
errno
==
8
:
print
_
(
"Error: You don't have permission to open
%
s."
)
%
port
print
_
(
"You might need to add yourself to the dialout group."
)
else
:
print
e
# Kill the scope anyway
return
self
.
statuscheck
=
True
self
.
statuscheck
=
True
if
port
!=
self
.
settings
.
port
:
if
port
!=
self
.
settings
.
port
:
self
.
set
(
"port"
,
port
)
self
.
set
(
"port"
,
port
)
...
...
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