Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
195
Issues
195
List
Boards
Labels
Service Desk
Milestones
Merge Requests
20
Merge Requests
20
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
181027dd
Commit
181027dd
authored
Jun 26, 2019
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPython: Simplify stream code
parent
5d812cbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
gajim/dev/ipython_view.py
gajim/dev/ipython_view.py
+4
-9
No files found.
gajim/dev/ipython_view.py
View file @
181027dd
...
...
@@ -141,12 +141,6 @@ def __init__(self, argv=None, user_ns=None, user_global_ns=None, cin=None,
else
:
IPython
.
frontend
.
terminal
.
interactiveshell
.
raw_input_original
=
\
input_func
if
cin
:
io
.
stdin
=
io
.
IOStream
(
cin
)
if
cout
:
io
.
stdout
=
io
.
IOStream
(
cout
)
if
cerr
:
io
.
stderr
=
io
.
IOStream
(
cerr
)
# This is to get rid of the blockage that accurs during
# IPython.Shell.InteractiveShell.user_setup()
...
...
@@ -163,10 +157,10 @@ def __init__(self, argv=None, user_ns=None, user_global_ns=None, cin=None,
cfg
=
Config
()
cfg
.
InteractiveShell
.
colors
=
"Linux"
# InteractiveShell's __init__
overwrites io.stdout,io.stderr with
# s
ys.stdout, sys.stderr, this makes sure they are righ
t
# InteractiveShell's __init__
gets a reference of stdout and stderr
# s
o we save the standard here to revert it after ini
t
old_stdout
,
old_stderr
=
sys
.
stdout
,
sys
.
stderr
sys
.
stdout
,
sys
.
stderr
=
io
.
stdout
.
stream
,
io
.
stderr
.
stream
sys
.
stdout
,
sys
.
stderr
=
cout
,
cerr
# InteractiveShell inherits from SingletonConfigurable so use instance()
if
parse_version
(
IPython
.
release
.
version
)
>=
parse_version
(
"1.2.1"
):
...
...
@@ -177,6 +171,7 @@ def __init__(self, argv=None, user_ns=None, user_global_ns=None, cin=None,
IPython
.
frontend
.
terminal
.
embed
.
InteractiveShellEmbed
.
instance
(
config
=
cfg
,
user_ns
=
user_ns
)
# Set back stdout and stderr to what it was before
sys
.
stdout
,
sys
.
stderr
=
old_stdout
,
old_stderr
self
.
IP
.
system
=
lambda
cmd
:
self
.
shell
(
self
.
IP
.
var_expand
(
cmd
),
...
...
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