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
f7e14bf7
Commit
f7e14bf7
authored
Nov 27, 2011
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:kliment/Printrun
parents
1eee27aa
edeb4339
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
printcore.py
printcore.py
+10
-1
pronsole.py
pronsole.py
+2
-2
No files found.
printcore.py
View file @
f7e14bf7
#!/usr/bin/env python
#!/usr/bin/env python
from
serial
import
Serial
from
serial
import
Serial
from
threading
import
Thread
from
threading
import
Thread
from
select
import
error
as
SelectError
import
time
import
time
import
sys
import
sys
...
@@ -76,7 +77,15 @@ class printcore():
...
@@ -76,7 +77,15 @@ class printcore():
while
(
True
):
while
(
True
):
if
(
not
self
.
printer
or
not
self
.
printer
.
isOpen
):
if
(
not
self
.
printer
or
not
self
.
printer
.
isOpen
):
break
break
try
:
line
=
self
.
printer
.
readline
()
line
=
self
.
printer
.
readline
()
except
SelectError
,
e
:
if
'Bad file descriptor'
in
e
.
args
[
1
]:
print
"Can't read from printer (disconnected?)."
break
else
:
raise
if
(
len
(
line
)
>
1
):
if
(
len
(
line
)
>
1
):
self
.
log
+=
[
line
]
self
.
log
+=
[
line
]
if
self
.
recvcb
is
not
None
:
if
self
.
recvcb
is
not
None
:
...
...
pronsole.py
View file @
f7e14bf7
...
@@ -809,14 +809,14 @@ class pronsole(cmd.Cmd):
...
@@ -809,14 +809,14 @@ class pronsole(cmd.Cmd):
print
"! os.listdir('.')"
print
"! os.listdir('.')"
def
default
(
self
,
l
):
def
default
(
self
,
l
):
if
(
l
[
0
]
==
'M'
or
l
[
0
]
==
"G"
):
if
(
l
[
0
]
==
'M'
or
l
[
0
]
==
"G"
or
l
[
0
]
==
'T'
):
if
(
self
.
p
and
self
.
p
.
online
):
if
(
self
.
p
and
self
.
p
.
online
):
print
"SENDING:"
+
l
print
"SENDING:"
+
l
self
.
p
.
send_now
(
l
)
self
.
p
.
send_now
(
l
)
else
:
else
:
print
"Printer is not online."
print
"Printer is not online."
return
return
if
(
l
[
0
]
==
'm'
or
l
[
0
]
==
"g"
):
if
(
l
[
0
]
==
'm'
or
l
[
0
]
==
"g"
or
l
[
0
]
==
't'
):
if
(
self
.
p
and
self
.
p
.
online
):
if
(
self
.
p
and
self
.
p
.
online
):
print
"SENDING:"
+
l
.
upper
()
print
"SENDING:"
+
l
.
upper
()
self
.
p
.
send_now
(
l
.
upper
())
self
.
p
.
send_now
(
l
.
upper
())
...
...
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