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
fe1cc166
Commit
fe1cc166
authored
Jun 12, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of github.com:kliment/Printrun into experimental
parents
fc43d553
c4f61a4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
22 deletions
+45
-22
printcore.py
printcore.py
+4
-1
pronsole.py
pronsole.py
+6
-1
prontserve.py
prontserve.py
+35
-18
basic_auth.py
server/basic_auth.py
+0
-2
No files found.
printcore.py
View file @
fe1cc166
...
...
@@ -103,6 +103,9 @@ class printcore():
self
.
read_thread
.
join
()
self
.
read_thread
=
None
self
.
_stop_sender
()
if
self
.
print_thread
:
self
.
printing
=
False
self
.
print_thread
.
join
()
try
:
self
.
printer
.
close
()
except
socket
.
error
:
...
...
@@ -426,7 +429,7 @@ class printcore():
traceback
.
print_exc
()
finally
:
self
.
print_thread
=
None
self
.
_start_sender
()
if
self
.
stop_send_thread
==
False
:
self
.
_start_sender
()
#now only "pause" is implemented as host command
def
processHostCommand
(
self
,
command
):
...
...
pronsole.py
View file @
fe1cc166
...
...
@@ -461,7 +461,12 @@ class pronsole(cmd.Cmd):
except
:
pass
return
baselist
+
glob
.
glob
(
'/dev/ttyUSB*'
)
+
glob
.
glob
(
'/dev/ttyACM*'
)
+
glob
.
glob
(
"/dev/tty.*"
)
+
glob
.
glob
(
"/dev/cu.*"
)
+
glob
.
glob
(
"/dev/rfcomm*"
)
for
g
in
[
'/dev/ttyUSB*'
,
'/dev/ttyACM*'
,
"/dev/tty.*"
,
"/dev/cu.*"
,
"/dev/rfcomm*"
]:
baselist
+=
glob
.
glob
(
g
)
return
filter
(
self
.
_bluetoothSerialFilter
,
baselist
)
def
_bluetoothSerialFilter
(
self
,
serial
):
return
not
(
"Bluetooth"
in
serial
or
"FireFly"
in
serial
)
def
online
(
self
):
self
.
log
(
"
\r
Printer is now online"
)
...
...
prontserve.py
View file @
fe1cc166
...
...
@@ -558,6 +558,10 @@ if __name__ == "__main__":
help
=
'Does not connect to the 3D printer'
)
parser
.
add_argument
(
'--loud'
,
default
=
False
,
action
=
'store_true'
,
help
=
'Enables verbose printer output'
)
args
=
parser
.
parse_args
()
dry_run
=
args
.
dry_run
...
...
@@ -567,27 +571,40 @@ if __name__ == "__main__":
sys
.
stdout
.
write
(
"
\x1B
[0;33m Dry Run
\x1B
[0m"
)
print
""
print
"Prontserve is starting..."
prontserve
=
Prontserve
(
dry_run
=
dry_run
)
if
dry_run
==
False
:
prontserve
.
do_connect
(
""
)
time
.
sleep
(
1
)
prontserve
.
run_sensor_loop
()
prontserve
.
run_print_queue_loop
()
application
.
listen
(
8888
)
print
"
\n
"
+
"-"
*
80
welcome
=
textwrap
.
dedent
(
u"""
+---+
\x1B
[0;32mProntserve: Your printer just got a whole lot better.
\x1B
[0m
|
\u2713
| Ready to print.
+---+ More details at http://localhost:8888/"""
)
warn_if_dry_run
()
sys
.
stdout
.
write
(
welcome
)
print
"
\n
"
warn_if_dry_run
()
print
"-"
*
80
+
"
\n
"
prontserve
.
p
.
loud
=
args
.
loud
try
:
if
dry_run
==
False
:
prontserve
.
do_connect
(
""
)
if
prontserve
.
p
.
printer
==
None
:
sys
.
exit
(
1
)
print
"Connecting to printer..."
for
x
in
range
(
0
,
50
-
1
):
if
prontserve
.
p
.
online
==
True
:
break
sys
.
stdout
.
write
(
"."
)
sys
.
stdout
.
flush
()
time
.
sleep
(
0.1
)
print
""
if
prontserve
.
p
.
online
==
False
:
print
"Unable to connect to printer: Connection timed-out."
sys
.
exit
(
1
)
time
.
sleep
(
1
)
prontserve
.
run_sensor_loop
()
prontserve
.
run_print_queue_loop
()
application
.
listen
(
8888
)
print
"
\n
"
+
"-"
*
80
welcome
=
textwrap
.
dedent
(
u"""
+---+
\x1B
[0;32mProntserve: Your printer just got a whole lot better.
\x1B
[0m
|
\u2713
| Ready to print.
+---+ More details at http://localhost:8888/"""
)
warn_if_dry_run
()
sys
.
stdout
.
write
(
welcome
)
print
"
\n
"
warn_if_dry_run
()
print
"-"
*
80
+
"
\n
"
prontserve
.
ioloop
.
start
()
except
:
prontserve
.
p
.
disconnect
()
server/basic_auth.py
View file @
fe1cc166
...
...
@@ -89,5 +89,3 @@ def interceptor(func):
cls
.
_execute
=
wrapper
(
cls
.
_execute
)
return
cls
return
classwrapper
print
"moo"
\ No newline at end of file
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