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
c5963dae
Commit
c5963dae
authored
Dec 10, 2012
by
Gary Hodgson
Committed by
Guillaume Seguin
May 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more info for serial exceptions
Conflicts: printcore.py
parent
267b9db2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
printcore.py
printcore.py
+9
-8
No files found.
printcore.py
View file @
c5963dae
...
...
@@ -167,17 +167,18 @@ class printcore():
except
:
pass
if
self
.
loud
:
print
"RECV: "
,
line
.
rstrip
()
return
line
except
SelectError
,
e
:
except
SelectError
as
e
:
if
'Bad file descriptor'
in
e
.
args
[
1
]:
print
"Can't read from printer (disconnected?)
."
print
"Can't read from printer (disconnected?)
({0}): {1}"
.
format
(
e
.
errno
,
e
.
strerror
)
return
None
else
:
print
"SelectError ({0}): {1}"
.
format
(
e
.
errno
,
e
.
strerror
)
raise
except
SerialException
,
e
:
print
"Can't read from printer (disconnected?)
."
except
SerialException
as
e
:
print
"Can't read from printer (disconnected?)
({0}): {1}"
.
format
(
e
.
errno
,
e
.
strerror
)
return
None
except
OSError
,
e
:
print
"Can't read from printer (disconnected?)
."
except
OSError
as
e
:
print
"Can't read from printer (disconnected?)
({0}): {1}"
.
format
(
e
.
errno
,
e
.
strerror
)
return
None
def
_listen_can_continue
(
self
):
...
...
@@ -476,9 +477,9 @@ class printcore():
self
.
printer
.
write
(
str
(
command
+
"
\n
"
))
self
.
printer
.
flush
()
except
SerialException
,
e
:
print
"Can't write to printer (disconnected?)
."
print
"Can't write to printer (disconnected?)
({0}): {1}"
.
format
(
e
.
errno
,
e
.
strerror
)
except
RuntimeError
,
e
:
print
"Socket connection broken, disconnected.
"
print
"Socket connection broken, disconnected.
({0}): {1}"
.
format
(
e
.
errno
,
e
.
strerror
)
if
__name__
==
'__main__'
:
baud
=
115200
...
...
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