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
ddf5eff7
Commit
ddf5eff7
authored
Jun 05, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve reporting of errors in printcore's connect()
parent
a1fbee42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
printcore.py
printcore.py
+4
-4
No files found.
printcore.py
View file @
ddf5eff7
...
@@ -144,21 +144,21 @@ class printcore():
...
@@ -144,21 +144,21 @@ class printcore():
self
.
printer_tcp
.
connect
((
hostname
,
port
))
self
.
printer_tcp
.
connect
((
hostname
,
port
))
self
.
printer_tcp
.
settimeout
(
self
.
timeout
)
self
.
printer_tcp
.
settimeout
(
self
.
timeout
)
self
.
printer
=
self
.
printer_tcp
.
makefile
()
self
.
printer
=
self
.
printer_tcp
.
makefile
()
except
socket
.
error
:
except
socket
.
error
as
e
:
print
_
(
"Could not connect to
%
s:
%
s:"
)
%
(
hostname
,
port
)
print
_
(
"Could not connect to
%
s:
%
s:"
)
%
(
hostname
,
port
)
self
.
printer
=
None
self
.
printer
=
None
self
.
printer_tcp
=
None
self
.
printer_tcp
=
None
traceback
.
print_exc
(
)
print
_
(
"Socket error
%
s:
%
s"
)
%
(
e
.
errno
,
e
.
strerror
)
return
return
else
:
else
:
disable_hup
(
self
.
port
)
disable_hup
(
self
.
port
)
self
.
printer_tcp
=
None
self
.
printer_tcp
=
None
try
:
try
:
self
.
printer
=
Serial
(
port
=
self
.
port
,
baudrate
=
self
.
baud
,
timeout
=
0.25
)
self
.
printer
=
Serial
(
port
=
self
.
port
,
baudrate
=
self
.
baud
,
timeout
=
0.25
)
except
SerialException
:
except
SerialException
as
e
:
print
_
(
"Could not connect to
%
s at baudrate
%
s:"
)
%
(
self
.
port
,
self
.
baud
)
print
_
(
"Could not connect to
%
s at baudrate
%
s:"
)
%
(
self
.
port
,
self
.
baud
)
self
.
printer
=
None
self
.
printer
=
None
traceback
.
print_exc
()
print
_
(
"Serial error:
%
s"
)
%
e
return
return
self
.
stop_read_thread
=
False
self
.
stop_read_thread
=
False
self
.
read_thread
=
Thread
(
target
=
self
.
_listen
)
self
.
read_thread
=
Thread
(
target
=
self
.
_listen
)
...
...
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