Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
5a26554d
Commit
5a26554d
authored
Jul 06, 2021
by
Matias Guijarro
Browse files
ptpython output capture: suppress Out prompt
parent
4f050f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/shell/cli/repl.py
View file @
5a26554d
...
...
@@ -8,6 +8,7 @@
"""Bliss REPL (Read Eval Print Loop)"""
import
asyncio
import
contextlib
import
re
import
os
import
sys
import
types
...
...
@@ -277,8 +278,10 @@ class PromptToolkitOutputWrapper(DummyOutput):
return
WrappedStdout
(
self
.
_output_buffer
)
def
acknowledge_output
(
self
):
self
.
_output
.
append
(
""
.
join
(
self
.
_output_buffer
)
)
txt
=
""
.
join
(
self
.
_output_buffer
)
self
.
_output_buffer
.
clear
()
txt
=
re
.
sub
(
"^(\s+Out\s\[\d+\]:\s+)"
,
""
,
txt
,
count
=
1
,
flags
=
re
.
MULTILINE
)
self
.
_output
.
append
(
txt
)
def
__getitem__
(
self
,
item_no
):
if
item_no
>
0
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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