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
80e313dc
Commit
80e313dc
authored
Jun 03, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lock connect() int printcore (harden against #153)
parent
ffec0fa3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
printcore.py
printcore.py
+11
-1
No files found.
printcore.py
View file @
80e313dc
...
...
@@ -17,15 +17,24 @@
from
serial
import
Serial
,
SerialException
from
select
import
error
as
SelectError
from
threading
import
Thread
from
threading
import
Thread
,
Lock
import
time
,
getopt
,
sys
import
platform
,
os
,
traceback
import
socket
import
re
from
functools
import
wraps
from
collections
import
deque
from
printrun.GCodeAnalyzer
import
GCodeAnalyzer
from
printrun
import
gcoder
def
locked
(
f
):
@
wraps
(
f
)
def
inner
(
*
args
,
**
kw
):
with
inner
.
lock
:
return
f
(
*
args
,
**
kw
)
inner
.
lock
=
Lock
()
return
inner
def
control_ttyhup
(
port
,
disable_hup
):
"""Controls the HUPCL"""
if
platform
.
system
()
==
"Linux"
:
...
...
@@ -97,6 +106,7 @@ class printcore():
self
.
online
=
False
self
.
printing
=
False
@
locked
def
connect
(
self
,
port
=
None
,
baud
=
None
):
"""Set port and baudrate if given, then connect to printer
"""
...
...
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