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
6cb8ff76
Commit
6cb8ff76
authored
Jun 02, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #532, add sdlisting_echo property, rename listing to sdlisting
parent
08bc92b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
pronsole.py
printrun/pronsole.py
+11
-9
pronterface.py
printrun/pronterface.py
+4
-4
No files found.
printrun/pronsole.py
View file @
6cb8ff76
...
...
@@ -126,7 +126,8 @@ class pronsole(cmd.Cmd):
self
.
filename
=
None
self
.
rpc_server
=
None
self
.
curlayer
=
0
self
.
listing
=
0
self
.
sdlisting
=
0
self
.
sdlisting_echo
=
0
self
.
sdfiles
=
[]
self
.
paused
=
False
self
.
sdprinting
=
0
...
...
@@ -1045,23 +1046,24 @@ class pronsole(cmd.Cmd):
def
help_resume
(
self
):
self
.
log
(
_
(
"Resumes a paused print."
))
def
listfiles
(
self
,
line
,
echo
=
False
):
def
listfiles
(
self
,
line
):
if
"Begin file list"
in
line
:
self
.
listing
=
1
self
.
sd
listing
=
1
elif
"End file list"
in
line
:
self
.
listing
=
0
self
.
sd
listing
=
0
self
.
recvlisteners
.
remove
(
self
.
listfiles
)
if
echo
:
if
self
.
sdlisting_
echo
:
self
.
log
(
_
(
"Files on SD card:"
))
self
.
log
(
"
\n
"
.
join
(
self
.
sdfiles
))
elif
self
.
listing
:
elif
self
.
sd
listing
:
self
.
sdfiles
.
append
(
line
.
strip
()
.
lower
())
def
_do_ls
(
self
,
echo
):
# FIXME: this was 2, but I think it should rather be 0 as in do_upload
self
.
listing
=
0
self
.
sdlisting
=
0
self
.
sdlisting_echo
=
echo
self
.
sdfiles
=
[]
self
.
recvlisteners
.
append
(
lambda
l
:
self
.
listfiles
(
l
,
echo
)
)
self
.
recvlisteners
.
append
(
self
.
listfiles
)
self
.
p
.
send_now
(
"M20"
)
def
do_ls
(
self
,
l
):
...
...
@@ -1201,7 +1203,7 @@ class pronsole(cmd.Cmd):
if
report_type
==
REPORT_TEMP
:
self
.
status
.
update_tempreading
(
l
)
tstring
=
l
.
rstrip
()
if
tstring
!=
"ok"
and
not
self
.
listing
\
if
tstring
!=
"ok"
and
not
self
.
sd
listing
\
and
not
self
.
monitoring
and
report_type
==
REPORT_NONE
:
if
tstring
[:
5
]
==
"echo:"
:
tstring
=
tstring
[
5
:]
.
lstrip
()
...
...
printrun/pronterface.py
View file @
6cb8ff76
...
...
@@ -1213,7 +1213,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
if
not
self
.
p
.
online
:
self
.
sdfiles
=
[]
return
self
.
listing
=
0
self
.
sd
listing
=
0
self
.
sdfiles
=
[]
self
.
recvlisteners
.
append
(
self
.
listfiles
)
self
.
p
.
send_now
(
"M21"
)
...
...
@@ -1672,12 +1672,12 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
def
listfiles
(
self
,
line
,
ignored
=
False
):
if
"Begin file list"
in
line
:
self
.
listing
=
1
self
.
sd
listing
=
1
elif
"End file list"
in
line
:
self
.
listing
=
0
self
.
sd
listing
=
0
self
.
recvlisteners
.
remove
(
self
.
listfiles
)
wx
.
CallAfter
(
self
.
filesloaded
)
elif
self
.
listing
:
elif
self
.
sd
listing
:
self
.
sdfiles
.
append
(
line
.
strip
()
.
lower
())
def
waitforsdresponse
(
self
,
l
):
...
...
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