Add debian/patches/02_ipython5.patch to fix python console (Closes: #848119)
sthibault
6 years ago
|
0 |
accerciser (3.22.0-3) UNRELEASED; urgency=medium
|
|
1 |
|
|
2 |
* Add debian/patches/02_ipython5.patch to fix python console (Closes: #848119)
|
|
3 |
|
|
4 |
-- Samuel Thibault <sthibault@debian.org> Tue, 12 Sep 2017 16:54:50 +0200
|
|
5 |
|
0 | 6 |
accerciser (3.22.0-2) unstable; urgency=medium
|
1 | 7 |
|
2 | 8 |
* Add missing Depends on gir1.2-glib-2.0 and gir1.2-rsvg-2.0.
|
|
0 |
diff --git a/plugins/ipython_view.py b/plugins/ipython_view.py
|
|
1 |
index 04f2d53..ae3d2be 100755
|
|
2 |
--- a/plugins/ipython_view.py
|
|
3 |
+++ b/plugins/ipython_view.py
|
|
4 |
@@ -125,7 +125,8 @@ class IterableIPShell:
|
|
5 |
self.complete_sep = re.compile('[\s\{\}\[\]\(\)]')
|
|
6 |
self.updateNamespace({'exit':lambda:None})
|
|
7 |
self.updateNamespace({'quit':lambda:None})
|
|
8 |
- self.IP.readline_startup_hook(self.IP.pre_readline)
|
|
9 |
+ if parse_version(IPython.release.version) < parse_version("5.0.0"):
|
|
10 |
+ self.IP.readline_startup_hook(self.IP.pre_readline)
|
|
11 |
# Workaround for updating namespace with sys.modules
|
|
12 |
#
|
|
13 |
self.__update_namespace()
|
|
14 |
@@ -208,13 +209,16 @@ class IterableIPShell:
|
|
15 |
# Backwards compatibility with ipyton-0.11
|
|
16 |
#
|
|
17 |
ver = IPython.__version__
|
|
18 |
- if '0.11' in ver:
|
|
19 |
+ if ver[0:4] == '0.11':
|
|
20 |
prompt = self.IP.hooks.generate_prompt(is_continuation)
|
|
21 |
- else:
|
|
22 |
+ elif parse_version(IPython.release.version) < parse_version("5.0.0"):
|
|
23 |
if is_continuation:
|
|
24 |
prompt = self.IP.prompt_manager.render('in2')
|
|
25 |
else:
|
|
26 |
prompt = self.IP.prompt_manager.render('in')
|
|
27 |
+ else:
|
|
28 |
+ # TODO: update to IPython 5.x and later
|
|
29 |
+ prompt = "In [%d]: " % self.IP.execution_count
|
|
30 |
|
|
31 |
return prompt
|
|
32 |
|
0 | 0 |
01_remove_site_package_version.patch
|
|
1 |
02_ipython5.patch
|