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
44ceb6ff
Commit
44ceb6ff
authored
Nov 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP #575: improve // actions behavior in pronsole
parent
122631bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
printcore.py
printrun/printcore.py
+10
-9
pronsole.py
printrun/pronsole.py
+6
-0
No files found.
printrun/printcore.py
View file @
44ceb6ff
...
...
@@ -19,7 +19,7 @@ __version__ = "2014.08.01"
from
serial
import
Serial
,
SerialException
,
PARITY_ODD
,
PARITY_NONE
from
select
import
error
as
SelectError
from
threading
import
Thread
,
Lock
import
threading
from
Queue
import
Queue
,
Empty
as
QueueEmpty
import
time
import
platform
...
...
@@ -44,7 +44,7 @@ def locked(f):
def
inner
(
*
args
,
**
kw
):
with
inner
.
lock
:
return
f
(
*
args
,
**
kw
)
inner
.
lock
=
Lock
()
inner
.
lock
=
threading
.
Lock
()
return
inner
def
control_ttyhup
(
port
,
disable_hup
):
...
...
@@ -126,6 +126,7 @@ class printcore():
if
self
.
printer
:
if
self
.
read_thread
:
self
.
stop_read_thread
=
True
if
threading
.
current_thread
()
!=
self
.
read_thread
:
self
.
read_thread
.
join
()
self
.
read_thread
=
None
if
self
.
print_thread
:
...
...
@@ -205,7 +206,7 @@ class printcore():
self
.
printer
=
None
return
self
.
stop_read_thread
=
False
self
.
read_thread
=
Thread
(
target
=
self
.
_listen
)
self
.
read_thread
=
threading
.
Thread
(
target
=
self
.
_listen
)
self
.
read_thread
.
start
()
self
.
_start_sender
()
...
...
@@ -328,7 +329,7 @@ class printcore():
def
_start_sender
(
self
):
self
.
stop_send_thread
=
False
self
.
send_thread
=
Thread
(
target
=
self
.
_sender
)
self
.
send_thread
=
threading
.
Thread
(
target
=
self
.
_sender
)
self
.
send_thread
.
start
()
def
_stop_sender
(
self
):
...
...
@@ -371,7 +372,7 @@ class printcore():
return
True
self
.
clear
=
False
resuming
=
(
startindex
!=
0
)
self
.
print_thread
=
Thread
(
target
=
self
.
_print
,
self
.
print_thread
=
threading
.
Thread
(
target
=
self
.
_print
,
kwargs
=
{
"resuming"
:
resuming
})
self
.
print_thread
.
start
()
return
True
...
...
@@ -451,7 +452,7 @@ class printcore():
self
.
paused
=
False
self
.
printing
=
True
self
.
print_thread
=
Thread
(
target
=
self
.
_print
,
self
.
print_thread
=
threading
.
Thread
(
target
=
self
.
_print
,
kwargs
=
{
"resuming"
:
True
})
self
.
print_thread
.
start
()
...
...
printrun/pronsole.py
View file @
44ceb6ff
...
...
@@ -1233,12 +1233,18 @@ class pronsole(cmd.Cmd):
command
=
command
[
1
]
if
command
==
"pause"
:
self
.
do_pause
(
None
)
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
flush
()
return
True
elif
command
==
"resume"
:
self
.
do_resume
(
None
)
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
flush
()
return
True
elif
command
==
"disconnect"
:
self
.
do_disconnect
(
None
)
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
flush
()
return
True
return
False
...
...
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