Hello community,
here is the log from the commit of package python-qtconsole for
openSUSE:Factory checked in at 2020-11-29 12:29:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-qtconsole (Old)
and /work/SRC/openSUSE:Factory/.python-qtconsole.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-qtconsole"
Sun Nov 29 12:29:55 2020 rev:13 rq:851343 version:5.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-qtconsole/python-qtconsole.changes
2020-09-17 14:52:06.083982611 +0200
+++
/work/SRC/openSUSE:Factory/.python-qtconsole.new.5913/python-qtconsole.changes
2020-11-29 12:30:12.590110294 +0100
@@ -1,0 +2,13 @@
+Thu Nov 26 17:51:02 UTC 2020 - Arun Persaud <[email protected]>
+
+- update to version 5.0.1:
+ * Add python_requires to setup.py for Python 3.6+ compatibility
+
+- changes from version 5.0.0:
+ * Additions
+ + Add option to set completion type while running.
+ * Changes
+ + Emit kernel_restarted after restarting kernel.
+ + Drop support for Python 2.7 and 3.5.
+
+-------------------------------------------------------------------
Old:
----
qtconsole-4.7.7.tar.gz
New:
----
qtconsole-5.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-qtconsole.spec ++++++
--- /var/tmp/diff_new_pack.PTZx7e/_old 2020-11-29 12:30:15.186112920 +0100
+++ /var/tmp/diff_new_pack.PTZx7e/_new 2020-11-29 12:30:15.190112923 +0100
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-qtconsole
-Version: 4.7.7
+Version: 5.0.1
Release: 0
Summary: Jupyter Qt console
License: BSD-3-Clause
++++++ qtconsole-4.7.7.tar.gz -> qtconsole-5.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/PKG-INFO new/qtconsole-5.0.1/PKG-INFO
--- old/qtconsole-4.7.7/PKG-INFO 2020-09-03 06:02:46.000000000 +0200
+++ new/qtconsole-5.0.1/PKG-INFO 2020-11-24 18:27:25.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qtconsole
-Version: 4.7.7
+Version: 5.0.1
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
@@ -9,7 +9,9 @@
License: BSD
Description: # Jupyter QtConsole
- [](https://travis-ci.org/jupyter/qtconsole)
+ 
+ 
+ 
[](https://coveralls.io/github/jupyter/qtconsole?branch=master)
[](https://qtconsole.readthedocs.io/en/stable/)
[](https://groups.google.com/forum/#!forum/jupyter)
@@ -90,11 +92,12 @@
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Requires-Python: >= 3.6
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/README.md
new/qtconsole-5.0.1/README.md
--- old/qtconsole-4.7.7/README.md 2019-05-27 15:00:29.000000000 +0200
+++ new/qtconsole-5.0.1/README.md 2020-11-21 23:57:26.000000000 +0100
@@ -1,6 +1,8 @@
# Jupyter QtConsole
-[](https://travis-ci.org/jupyter/qtconsole)
+
+
+
[](https://coveralls.io/github/jupyter/qtconsole?branch=master)
[](https://qtconsole.readthedocs.io/en/stable/)
[](https://groups.google.com/forum/#!forum/jupyter)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/docs/gh-pages.py
new/qtconsole-5.0.1/docs/gh-pages.py
--- old/qtconsole-4.7.7/docs/gh-pages.py 2015-12-20 15:40:14.000000000
+0100
+++ new/qtconsole-5.0.1/docs/gh-pages.py 2020-11-21 05:27:38.000000000
+0100
@@ -14,8 +14,6 @@
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
-from __future__ import print_function
-
import os
import shutil
import sys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/docs/source/changelog.rst
new/qtconsole-5.0.1/docs/source/changelog.rst
--- old/qtconsole-4.7.7/docs/source/changelog.rst 2020-09-03
05:55:38.000000000 +0200
+++ new/qtconsole-5.0.1/docs/source/changelog.rst 2020-11-24
18:22:55.000000000 +0100
@@ -3,6 +3,35 @@
Changes in Jupyter Qt console
=============================
+.. _5.0:
+
+5.0
+~~~
+
+5.0.1
+-----
+
+`5.0.1 on GitHub <https://github.com/jupyter/qtconsole/milestones/5.0.1>`__
+
+* Add python_requires to setup.py for Python 3.6+ compatibility
+
+5.0.0
+-----
+
+`5.0.0 on GitHub <https://github.com/jupyter/qtconsole/milestones/5.0>`__
+
+Additions
++++++++++
+
+- Add option to set completion type while running.
+
+Changes
++++++++
+
+- Emit kernel_restarted after restarting kernel.
+- Drop support for Python 2.7 and 3.5.
+
+
.. _4.7:
4.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/docs/source/conf.py
new/qtconsole-5.0.1/docs/source/conf.py
--- old/qtconsole-4.7.7/docs/source/conf.py 2017-08-12 17:49:25.000000000
+0200
+++ new/qtconsole-5.0.1/docs/source/conf.py 2020-11-21 05:27:38.000000000
+0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-#
# Jupyter Qt Console documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 13 10:20:17 2015.
#
@@ -251,8 +249,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'JupyterQtConsole.tex', u'Jupyter Qt Console Documentation',
- u'Jupyter Development Team', 'manual'),
+ (master_doc, 'JupyterQtConsole.tex', 'Jupyter Qt Console Documentation',
+ 'Jupyter Development Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -281,7 +279,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'jupyterqtconsole', u'Jupyter Qt Console Documentation',
+ (master_doc, 'jupyterqtconsole', 'Jupyter Qt Console Documentation',
[author], 1)
]
@@ -295,7 +293,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'JupyterQtConsole', u'Jupyter Qt Console Documentation',
+ (master_doc, 'JupyterQtConsole', 'Jupyter Qt Console Documentation',
author, 'JupyterQtConsole', 'One line description of project.',
'Miscellaneous'),
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/_version.py
new/qtconsole-5.0.1/qtconsole/_version.py
--- old/qtconsole-4.7.7/qtconsole/_version.py 2020-09-03 06:01:53.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/_version.py 2020-11-24 18:26:22.000000000
+0100
@@ -1,2 +1,2 @@
-version_info = (4, 7, 7)
+version_info = (5, 0, 1)
__version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/ansi_code_processor.py
new/qtconsole-5.0.1/qtconsole/ansi_code_processor.py
--- old/qtconsole-4.7.7/qtconsole/ansi_code_processor.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/ansi_code_processor.py 2020-11-21
05:27:38.000000000 +0100
@@ -12,7 +12,6 @@
from qtpy import QtGui
# Local imports
-from ipython_genutils.py3compat import string_types
from qtconsole.styles import dark_style
#-----------------------------------------------------------------------------
@@ -335,7 +334,7 @@
else:
return None
- if isinstance(constructor, string_types):
+ if isinstance(constructor, str):
# If this is an X11 color name, we just hope there is a close SVG
# color name. We could use QColor's static method
# 'setAllowX11ColorNames()', but this is global and only available
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/bracket_matcher.py
new/qtconsole-5.0.1/qtconsole/bracket_matcher.py
--- old/qtconsole-4.7.7/qtconsole/bracket_matcher.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/bracket_matcher.py 2020-11-21
05:27:38.000000000 +0100
@@ -23,7 +23,7 @@
text edit widget.
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit,
QtWidgets.QPlainTextEdit))
- super(BracketMatcher, self).__init__()
+ super().__init__()
# The format to apply to matching brackets.
self.format = QtGui.QTextCharFormat()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/call_tip_widget.py
new/qtconsole-5.0.1/qtconsole/call_tip_widget.py
--- old/qtconsole-4.7.7/qtconsole/call_tip_widget.py 2020-08-17
19:19:15.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/call_tip_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -19,7 +19,7 @@
text edit widget.
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit,
QtWidgets.QPlainTextEdit))
- super(CallTipWidget, self).__init__(None, QtCore.Qt.ToolTip)
+ super().__init__(None, QtCore.Qt.ToolTip)
self._hide_timer = QtCore.QBasicTimer()
self._text_edit = text_edit
@@ -62,7 +62,7 @@
elif etype == QtCore.QEvent.Leave:
self._leave_event_hide()
- return super(CallTipWidget, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
def timerEvent(self, event):
""" Reimplemented to hide the widget when the hide timer fires.
@@ -78,13 +78,13 @@
def enterEvent(self, event):
""" Reimplemented to cancel the hide timer.
"""
- super(CallTipWidget, self).enterEvent(event)
+ super().enterEvent(event)
self._hide_timer.stop()
def hideEvent(self, event):
""" Reimplemented to disconnect signal handlers and event filter.
"""
- super(CallTipWidget, self).hideEvent(event)
+ super().hideEvent(event)
# This fixes issue jupyter/qtconsole#383
try:
self._text_edit.cursorPositionChanged.disconnect(
@@ -96,7 +96,7 @@
def leaveEvent(self, event):
""" Reimplemented to start the hide timer.
"""
- super(CallTipWidget, self).leaveEvent(event)
+ super().leaveEvent(event)
self._leave_event_hide()
def paintEvent(self, event):
@@ -108,17 +108,17 @@
painter.drawPrimitive(QtWidgets.QStyle.PE_PanelTipLabel, option)
painter.end()
- super(CallTipWidget, self).paintEvent(event)
+ super().paintEvent(event)
def setFont(self, font):
""" Reimplemented to allow use of this method as a slot.
"""
- super(CallTipWidget, self).setFont(font)
+ super().setFont(font)
def showEvent(self, event):
""" Reimplemented to connect signal handlers and event filter.
"""
- super(CallTipWidget, self).showEvent(event)
+ super().showEvent(event)
self._text_edit.cursorPositionChanged.connect(
self._cursor_position_changed)
self._text_edit.installEventFilter(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/comms.py
new/qtconsole-5.0.1/qtconsole/comms.py
--- old/qtconsole-4.7.7/qtconsole/comms.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/comms.py 2020-11-21 05:27:38.000000000
+0100
@@ -12,7 +12,6 @@
from traitlets.config import LoggingConfigurable
from ipython_genutils.importstring import import_item
-from ipython_genutils.py3compat import string_types
import uuid
@@ -27,7 +26,7 @@
"""
def __init__(self, kernel_client, *args, **kwargs):
- super(CommManager, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
self.comms = {}
self.targets = {}
if kernel_client:
@@ -76,7 +75,7 @@
f can be a Python callable or an import string for one.
"""
- if isinstance(f, string_types):
+ if isinstance(f, str):
f = import_item(f)
self.targets[target_name] = f
@@ -192,7 +191,7 @@
"""
Create a new comm. Must call open to use.
"""
- super(Comm, self).__init__(target_name=target_name)
+ super().__init__(target_name=target_name)
self.target_name = target_name
self.kernel_client = kernel_client
if comm_id is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/completion_html.py
new/qtconsole-5.0.1/qtconsole/completion_html.py
--- old/qtconsole-4.7.7/qtconsole/completion_html.py 2020-09-03
05:53:18.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/completion_html.py 2020-11-21
05:27:38.000000000 +0100
@@ -1,5 +1,4 @@
"""A navigable completer for the qtconsole"""
-# coding : utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
@@ -16,30 +15,30 @@
if not item_matrix :
return ''
html_cols = []
- tds = lambda text : u'<td>'+text+u' </td>'
- trs = lambda text : u'<tr>'+text+u'</tr>'
+ tds = lambda text : '<td>'+text+' </td>'
+ trs = lambda text : '<tr>'+text+'</tr>'
tds_items = [list(map(tds, row)) for row in item_matrix]
if select :
row, col = select
- tds_items[row][col] = u'<td class="inverted">'\
+ tds_items[row][col] = '<td class="inverted">'\
+item_matrix[row][col]\
- +u' </td>'
+ +' </td>'
#select the right item
- html_cols = map(trs, (u''.join(row) for row in tds_items))
+ html_cols = map(trs, (''.join(row) for row in tds_items))
head = ''
foot = ''
if header :
- head = (u'<tr>'\
- +''.join((u'<td>'+header+u'</td>')*len(item_matrix[0]))\
+ head = ('<tr>'\
+ +''.join(('<td>'+header+'</td>')*len(item_matrix[0]))\
+'</tr>')
if footer :
- foot = (u'<tr>'\
- +''.join((u'<td>'+footer+u'</td>')*len(item_matrix[0]))\
+ foot = ('<tr>'\
+ +''.join(('<td>'+footer+'</td>')*len(item_matrix[0]))\
+'</tr>')
- html = (u'<table class="completion" style="white-space:pre"'
+ html = ('<table class="completion" style="white-space:pre"'
'cellspacing=0>' +
- head + (u''.join(html_cols)) + foot + u'</table>')
+ head + (''.join(html_cols)) + foot + '</table>')
return html
class SlidingInterval(object):
@@ -130,7 +129,7 @@
text edit widget.
"""
assert isinstance(console_widget._control, (QtWidgets.QTextEdit,
QtWidgets.QPlainTextEdit))
- super(CompletionHtml, self).__init__()
+ super().__init__()
self._text_edit = console_widget._control
self._console_widget = console_widget
@@ -192,7 +191,7 @@
elif etype == QtCore.QEvent.FocusOut:
self.cancel_completion()
- return super(CompletionHtml, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
#--------------------------------------------------------------------------
# 'CompletionHtml' interface
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/completion_plain.py
new/qtconsole-5.0.1/qtconsole/completion_plain.py
--- old/qtconsole-4.7.7/qtconsole/completion_plain.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/completion_plain.py 2020-11-21
05:27:38.000000000 +0100
@@ -19,7 +19,7 @@
text edit widget.
"""
assert isinstance(console_widget._control, (QtWidgets.QTextEdit,
QtWidgets.QPlainTextEdit))
- super(CompletionPlain, self).__init__()
+ super().__init__()
self._text_edit = console_widget._control
self._console_widget = console_widget
@@ -36,7 +36,7 @@
if etype in( QtCore.QEvent.KeyPress, QtCore.QEvent.FocusOut ):
self.cancel_completion()
- return super(CompletionPlain, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
#--------------------------------------------------------------------------
# 'CompletionPlain' interface
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/completion_widget.py
new/qtconsole-5.0.1/qtconsole/completion_widget.py
--- old/qtconsole-4.7.7/qtconsole/completion_widget.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/completion_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -20,7 +20,7 @@
"""
text_edit = console_widget._control
assert isinstance(text_edit, (QtWidgets.QTextEdit,
QtWidgets.QPlainTextEdit))
- super(CompletionWidget, self).__init__(parent=console_widget)
+ super().__init__(parent=console_widget)
self._text_edit = text_edit
self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
@@ -58,7 +58,7 @@
else:
self.cancel_completion()
- return super(CompletionWidget, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
def keyPressEvent(self, event):
key = event.key()
@@ -70,7 +70,7 @@
elif key in (QtCore.Qt.Key_Up, QtCore.Qt.Key_Down,
QtCore.Qt.Key_PageUp, QtCore.Qt.Key_PageDown,
QtCore.Qt.Key_Home, QtCore.Qt.Key_End):
- return super(CompletionWidget, self).keyPressEvent(event)
+ return super().keyPressEvent(event)
else:
QtWidgets.QApplication.sendEvent(self._text_edit, event)
@@ -81,7 +81,7 @@
def hideEvent(self, event):
""" Reimplemented to disconnect signal handlers and event filter.
"""
- super(CompletionWidget, self).hideEvent(event)
+ super().hideEvent(event)
try:
self._text_edit.cursorPositionChanged.disconnect(self._update_current)
except TypeError:
@@ -91,7 +91,7 @@
def showEvent(self, event):
""" Reimplemented to connect signal handlers and event filter.
"""
- super(CompletionWidget, self).showEvent(event)
+ super().showEvent(event)
self._text_edit.cursorPositionChanged.connect(self._update_current)
self.installEventFilter(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/console_widget.py
new/qtconsole-5.0.1/qtconsole/console_widget.py
--- old/qtconsole-4.7.7/qtconsole/console_widget.py 2020-09-03
05:53:18.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/console_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -218,7 +218,7 @@
parent : QWidget, optional [default None]
The parent for this widget.
"""
- super(ConsoleWidget, self).__init__(**kw)
+ super().__init__(**kw)
if parent:
self.setParent(parent)
@@ -467,7 +467,7 @@
anchor = self._control.anchorAt(event.pos())
QtWidgets.QToolTip.showText(event.globalPos(), anchor)
- return super(ConsoleWidget, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
#---------------------------------------------------------------------------
# 'QWidget' interface
@@ -578,11 +578,11 @@
def _handle_is_complete_reply(self, msg):
if msg['parent_header'].get('msg_id', 0) != self._is_complete_msg_id:
return
- status = msg['content'].get('status', u'complete')
- indent = msg['content'].get('indent', u'')
+ status = msg['content'].get('status', 'complete')
+ indent = msg['content'].get('indent', '')
self._trigger_is_complete_callback(status != 'incomplete', indent)
- def _trigger_is_complete_callback(self, complete=False, indent=u''):
+ def _trigger_is_complete_callback(self, complete=False, indent=''):
if self._is_complete_msg_id is not None:
self._is_complete_msg_id = None
self._is_complete_callback(complete, indent)
@@ -777,6 +777,18 @@
font = property(_get_font, _set_font)
+ def _set_completion_widget(self, gui_completion):
+ """ Set gui completion widget.
+ """
+ if gui_completion == 'ncurses':
+ self._completion_widget = CompletionHtml(self)
+ elif gui_completion == 'droplist':
+ self._completion_widget = CompletionWidget(self)
+ elif gui_completion == 'plain':
+ self._completion_widget = CompletionPlain(self)
+
+ self.gui_completion = gui_completion
+
def open_anchor(self, anchor):
""" Open selected anchor in the default webbrowser
"""
@@ -1952,7 +1964,7 @@
def _indent(self, dedent=True):
""" Indent/Dedent current line or current text selection.
"""
- num_newlines = self._get_cursor().selectedText().count(u"\u2029")
+ num_newlines = self._get_cursor().selectedText().count("\u2029")
save_cur = self._get_cursor()
cur = self._get_cursor()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/frontend_widget.py
new/qtconsole-5.0.1/qtconsole/frontend_widget.py
--- old/qtconsole-4.7.7/qtconsole/frontend_widget.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/frontend_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -3,15 +3,12 @@
# Copyright (c) Jupyter Development Team
# Distributed under the terms of the Modified BSD License.
-from __future__ import print_function
-
from collections import namedtuple
import sys
import uuid
import re
from qtpy import QtCore, QtGui, QtWidgets
-from ipython_genutils import py3compat
from ipython_genutils.importstring import import_item
from qtconsole.base_frontend_mixin import BaseFrontendMixin
@@ -27,7 +24,7 @@
"""
def __init__(self, frontend, lexer=None):
- super(FrontendHighlighter,
self).__init__(frontend._control.document(), lexer=lexer)
+ super().__init__(frontend._control.document(), lexer=lexer)
self._current_offset = 0
self._frontend = frontend
self.highlighting_on = False
@@ -78,21 +75,21 @@
diff = len(string) - len(without_prompt)
if diff > 0:
self._current_offset = diff
- super(FrontendHighlighter, self).highlightBlock(without_prompt)
+ super().highlightBlock(without_prompt)
def rehighlightBlock(self, block):
""" Reimplemented to temporarily enable highlighting if disabled.
"""
old = self.highlighting_on
self.highlighting_on = True
- super(FrontendHighlighter, self).rehighlightBlock(block)
+ super().rehighlightBlock(block)
self.highlighting_on = old
def setFormat(self, start, count, format):
""" Reimplemented to highlight selectively.
"""
start += self._current_offset
- super(FrontendHighlighter, self).setFormat(start, count, format)
+ super().setFormat(start, count, format)
class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):
@@ -134,10 +131,7 @@
self.lexer = lexer_class()
def _lexer_class_default(self):
- if py3compat.PY3:
- return 'pygments.lexers.Python3Lexer'
- else:
- return 'pygments.lexers.PythonLexer'
+ return 'pygments.lexers.Python3Lexer'
lexer = Any()
def _lexer_default(self):
@@ -167,7 +161,7 @@
# -------------------------------------------------------------------------
def __init__(self, local_kernel=_local_kernel, *args, **kw):
- super(FrontendWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# FrontendWidget protected variables.
self._bracket_matcher = BracketMatcher(self._control)
self._call_tip_widget = CallTipWidget(self._control)
@@ -290,7 +284,7 @@
def _context_menu_make(self, pos):
""" Reimplemented to add an action for raw copy.
"""
- menu = super(FrontendWidget, self)._context_menu_make(pos)
+ menu = super()._context_menu_make(pos)
for before_action in menu.actions():
if before_action.shortcut().matches(QtGui.QKeySequence.Paste) == \
QtGui.QKeySequence.ExactMatch:
@@ -313,7 +307,11 @@
if self._control_key_down(event.modifiers(), include_command=False):
if key == QtCore.Qt.Key_C and self._executing:
- self.request_interrupt_kernel()
+ # If text is selected, the user probably wants to copy it.
+ if self.can_copy() and event.matches(QtGui.QKeySequence.Copy):
+ self.copy()
+ else:
+ self.request_interrupt_kernel()
return True
elif key == QtCore.Qt.Key_Period:
@@ -336,7 +334,7 @@
cursor.removeSelectedText()
return True
- return super(FrontendWidget,
self)._event_filter_console_keypress(event)
+ return super()._event_filter_console_keypress(event)
#---------------------------------------------------------------------------
# 'BaseFrontendMixin' abstract interface
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/history_console_widget.py
new/qtconsole-5.0.1/qtconsole/history_console_widget.py
--- old/qtconsole-4.7.7/qtconsole/history_console_widget.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/history_console_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -3,7 +3,6 @@
from qtpy import QtGui
-from ipython_genutils.py3compat import unicode_type
from traitlets import Bool
from .console_widget import ConsoleWidget
@@ -25,7 +24,7 @@
#---------------------------------------------------------------------------
def __init__(self, *args, **kw):
- super(HistoryConsoleWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# HistoryConsoleWidget protected variables.
self._history = []
@@ -40,7 +39,7 @@
""" Reimplemented to the store history. """
history = self.input_buffer if source is None else source
- super(HistoryConsoleWidget, self).do_execute(source, complete, indent)
+ super().do_execute(source, complete, indent)
if complete:
# Save the command unless it was an empty string or was identical
@@ -242,7 +241,7 @@
if index in self._history_edits:
return self._history_edits[index]
elif index == len(self._history):
- return unicode_type()
+ return str()
return self._history[index]
def _set_history(self, history):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/inprocess.py
new/qtconsole-5.0.1/qtconsole/inprocess.py
--- old/qtconsole-4.7.7/qtconsole/inprocess.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/inprocess.py 2020-11-21 05:27:38.000000000
+0100
@@ -27,13 +27,13 @@
def start(self):
""" Reimplemented to emit signal.
"""
- super(QtInProcessChannel, self).start()
+ super().start()
self.started.emit()
def stop(self):
""" Reimplemented to emit signal.
"""
- super(QtInProcessChannel, self).stop()
+ super().stop()
self.stopped.emit()
def call_handlers_later(self, *args, **kwds):
@@ -53,7 +53,7 @@
def flush(self, timeout=1.0):
""" Reimplemented to ensure that signals are dispatched immediately.
"""
- super(QtInProcessChannel, self).flush()
+ super().flush()
self.process_events()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/jupyter_widget.py
new/qtconsole-5.0.1/qtconsole/jupyter_widget.py
--- old/qtconsole-4.7.7/qtconsole/jupyter_widget.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/jupyter_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -115,7 +115,7 @@
#---------------------------------------------------------------------------
def __init__(self, *args, **kw):
- super(JupyterWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# JupyterWidget protected variables.
self._payload_handlers = {
@@ -191,7 +191,7 @@
self._show_interpreter_prompt(number)
self._request_info['execute'].pop(msg_id)
else:
- super(JupyterWidget, self)._handle_execute_reply(msg)
+ super()._handle_execute_reply(msg)
def _handle_history_reply(self, msg):
""" Handle history tail replies, which are only supported
@@ -218,7 +218,7 @@
history_items = content['history']
self.log.debug("Received history reply with %i entries",
len(history_items))
items = []
- last_cell = u""
+ last_cell = ""
for _, _, cell in history_items:
cell = cell.rstrip()
if cell != last_cell:
@@ -292,7 +292,7 @@
text = data['text/plain']
self._append_plain_text(text, True)
# This newline seems to be needed for text and html output.
- self._append_plain_text(u'\n', True)
+ self._append_plain_text('\n', True)
def _handle_kernel_info_reply(self, rep):
"""Handle kernel info replies."""
@@ -317,7 +317,7 @@
if self._starting:
# finish handling started channels
self._starting = False
- super(JupyterWidget, self)._started_channels()
+ super()._started_channels()
def _started_channels(self):
"""Make a history request"""
@@ -612,4 +612,4 @@
def __init__(self, *a, **kw):
warn("IPythonWidget is deprecated; use JupyterWidget",
DeprecationWarning)
- super(IPythonWidget, self).__init__(*a, **kw)
+ super().__init__(*a, **kw)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/kernel_mixins.py
new/qtconsole-5.0.1/qtconsole/kernel_mixins.py
--- old/qtconsole-4.7.7/qtconsole/kernel_mixins.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/kernel_mixins.py 2020-11-21
05:27:38.000000000 +0100
@@ -37,20 +37,20 @@
#---------------------------------------------------------------------------
def __init__(self, *args, **kwargs):
- super(QtKernelClientMixin, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
self.comm_manager = None
#------ Channel management
-------------------------------------------------
def start_channels(self, *args, **kw):
""" Reimplemented to emit signal.
"""
- super(QtKernelClientMixin, self).start_channels(*args, **kw)
+ super().start_channels(*args, **kw)
self.started_channels.emit()
self.comm_manager = CommManager(parent=self, kernel_client=self)
def stop_channels(self):
""" Reimplemented to emit signal.
"""
- super(QtKernelClientMixin, self).stop_channels()
+ super().stop_channels()
self.stopped_channels.emit()
self.comm_manager = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/kill_ring.py
new/qtconsole-5.0.1/qtconsole/kill_ring.py
--- old/qtconsole-4.7.7/qtconsole/kill_ring.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/kill_ring.py 2020-11-21 05:27:38.000000000
+0100
@@ -63,7 +63,7 @@
""" Create a kill ring attached to the specified Qt text edit.
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit,
QtWidgets.QPlainTextEdit))
- super(QtKillRing, self).__init__()
+ super().__init__()
self._ring = KillRing()
self._prev_yank = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/mainwindow.py
new/qtconsole-5.0.1/qtconsole/mainwindow.py
--- old/qtconsole-4.7.7/qtconsole/mainwindow.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/mainwindow.py 2020-11-21 05:27:38.000000000
+0100
@@ -53,7 +53,7 @@
JupyterWidget instance, attached to the same kernel.
"""
- super(MainWindow, self).__init__()
+ super().__init__()
self._kernel_counter = 0
self._external_kernel_counter = 0
self._app = app
@@ -563,6 +563,44 @@
triggered=self.clear_active_frontend)
self.add_menu_action(self.view_menu, self.clear_action)
+ self.completion_menu = self.view_menu.addMenu("&Completion type")
+
+ completion_group = QtWidgets.QActionGroup(self)
+ active_frontend_completion = self.active_frontend.gui_completion
+ ncurses_completion_action = QtWidgets.QAction(
+ "&ncurses",
+ self,
+ triggered=lambda: self.set_completion_widget_active_frontend(
+ 'ncurses'))
+ ncurses_completion_action.setCheckable(True)
+ ncurses_completion_action.setChecked(
+ active_frontend_completion == 'ncurses')
+ droplist_completion_action = QtWidgets.QAction(
+ "&droplist",
+ self,
+ triggered=lambda: self.set_completion_widget_active_frontend(
+ 'droplist'))
+ droplist_completion_action.setCheckable(True)
+ droplist_completion_action.setChecked(
+ active_frontend_completion == 'droplist')
+ plain_commpletion_action = QtWidgets.QAction(
+ "&plain",
+ self,
+ triggered=lambda: self.set_completion_widget_active_frontend(
+ 'plain'))
+ plain_commpletion_action.setCheckable(True)
+ plain_commpletion_action.setChecked(
+ active_frontend_completion == 'plain')
+
+ completion_group.addAction(ncurses_completion_action)
+ completion_group.addAction(droplist_completion_action)
+ completion_group.addAction(plain_commpletion_action)
+
+ self.completion_menu.addAction(ncurses_completion_action)
+ self.completion_menu.addAction(droplist_completion_action)
+ self.completion_menu.addAction(plain_commpletion_action)
+ self.completion_menu.setDefaultAction(ncurses_completion_action)
+
self.pager_menu = self.view_menu.addMenu("&Pager")
hsplit_action = QtWidgets.QAction(".. &Horizontal Split",
@@ -749,6 +787,9 @@
def set_paging_active_frontend(self, paging):
self.active_frontend._set_paging(paging)
+ def set_completion_widget_active_frontend(self, gui_completion):
+ self.active_frontend._set_completion_widget(gui_completion)
+
def get_available_syntax_styles(self):
"""Get a list with the syntax styles available."""
styles = list(get_all_styles())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/manager.py
new/qtconsole-5.0.1/qtconsole/manager.py
--- old/qtconsole-4.7.7/qtconsole/manager.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/manager.py 2020-11-21 05:27:38.000000000
+0100
@@ -24,7 +24,7 @@
self._timer.stop()
def poll(self):
- super(QtKernelRestarter, self).poll()
+ super().poll()
class QtKernelManager(KernelManager, QtKernelManagerMixin):
@@ -33,6 +33,10 @@
client_class = DottedObjectName('qtconsole.client.QtKernelClient')
autorestart = Bool(True, config=True)
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._is_restarting = False
+
def start_restarter(self):
if self.autorestart and self.has_kernel:
if self._restarter is None:
@@ -41,7 +45,7 @@
parent=self,
log=self.log,
)
- self._restarter.add_callback(self._handle_kernel_restarted)
+ self._is_restarting = True
self._restarter.start()
def stop_restarter(self):
@@ -49,5 +53,8 @@
if self._restarter is not None:
self._restarter.stop()
- def _handle_kernel_restarted(self):
- self.kernel_restarted.emit()
+ def post_start_kernel(self, **kw):
+ super().post_start_kernel(**kw)
+ if self._is_restarting:
+ self.kernel_restarted.emit()
+ self._is_restarting = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/pygments_highlighter.py
new/qtconsole-5.0.1/qtconsole/pygments_highlighter.py
--- old/qtconsole-4.7.7/qtconsole/pygments_highlighter.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/pygments_highlighter.py 2020-11-21
05:27:38.000000000 +0100
@@ -4,10 +4,9 @@
from qtpy import QtGui
from qtconsole.qstringhelpers import qstring_length
-from ipython_genutils.py3compat import PY3, string_types
from pygments.formatters.html import HtmlFormatter
from pygments.lexer import RegexLexer, _TokenType, Text, Error
-from pygments.lexers import PythonLexer, Python3Lexer
+from pygments.lexers import Python3Lexer
from pygments.styles import get_style_by_name
@@ -65,7 +64,7 @@
pos += 1
statestack = ['root']
statetokens = tokendefs['root']
- yield pos, Text, u'\n'
+ yield pos, Text, '\n'
continue
yield pos, Error, text[pos]
pos += 1
@@ -104,7 +103,7 @@
#---------------------------------------------------------------------------
def __init__(self, parent, lexer=None):
- super(PygmentsHighlighter, self).__init__(parent)
+ super().__init__(parent)
self._document = self.document()
self._formatter = HtmlFormatter(nowrap=True)
@@ -112,10 +111,7 @@
if lexer is not None:
self._lexer = lexer
else:
- if PY3:
- self._lexer = Python3Lexer()
- else:
- self._lexer = PythonLexer()
+ self._lexer = Python3Lexer()
def highlightBlock(self, string):
""" Highlight a block of text.
@@ -147,7 +143,7 @@
def set_style(self, style):
""" Sets the style to the specified Pygments style.
"""
- if isinstance(style, string_types):
+ if isinstance(style, str):
style = get_style_by_name(style)
self._style = style
self._clear_caches()
@@ -192,7 +188,7 @@
def _get_format_from_document(self, token, document):
""" Returns a QTextCharFormat for token by
"""
- code, html = next(self._formatter._format_lines([(token, u'dummy')]))
+ code, html = next(self._formatter._format_lines([(token, 'dummy')]))
self._document.setHtml(html)
return QtGui.QTextCursor(self._document).charFormat()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/qstringhelpers.py
new/qtconsole-5.0.1/qtconsole/qstringhelpers.py
--- old/qtconsole-4.7.7/qtconsole/qstringhelpers.py 2019-08-22
10:43:15.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/qstringhelpers.py 2020-11-21
05:27:38.000000000 +0100
@@ -1,24 +1,14 @@
-# -*- coding: utf-8 -*-
-#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""QString compatibility."""
-import sys
-
-
-PY2 = sys.version[0] == '2'
-
def qstring_length(text):
"""
Tries to compute what the length of an utf16-encoded QString would be.
"""
- if PY2:
- # I don't know what this is encoded in, so there is nothing I can do.
- return len(text)
utf16_text = text.encode('utf16')
length = len(utf16_text) // 2
# Remove Byte order mark.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/qtconsoleapp.py
new/qtconsole-5.0.1/qtconsole/qtconsoleapp.py
--- old/qtconsole-4.7.7/qtconsole/qtconsoleapp.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/qtconsoleapp.py 2020-11-21
05:27:38.000000000 +0100
@@ -40,8 +40,8 @@
try:
import ctypes, traceback
MB_ICONERROR = 0x00000010
- title = u'Error starting QtConsole'
- msg = u''.join(traceback.format_exception(exctype, value, tb))
+ title = 'Error starting QtConsole'
+ msg = ''.join(traceback.format_exception(exctype, value, tb))
ctypes.windll.user32.MessageBoxW(0, msg, title, MB_ICONERROR)
finally:
# Also call the old exception hook to let it do
@@ -174,7 +174,7 @@
widget_factory = Any(RichJupyterWidget)
def parse_command_line(self, argv=None):
- super(JupyterQtConsoleApp, self).parse_command_line(argv)
+ super().parse_command_line(argv)
self.build_kernel_argv(self.extra_args)
@@ -412,7 +412,7 @@
def initialize(self, argv=None):
self._init_asyncio_patch()
self.init_qt_app()
- super(JupyterQtConsoleApp, self).initialize(argv)
+ super().initialize(argv)
if self._dispatching:
return
# handle deprecated renames
@@ -429,7 +429,7 @@
self.init_signal()
def start(self):
- super(JupyterQtConsoleApp, self).start()
+ super().start()
# draw the window
if self.maximize:
@@ -446,7 +446,7 @@
def __init__(self, *a, **kw):
warn("IPythonQtConsoleApp is deprecated; use JupyterQtConsoleApp",
DeprecationWarning)
- super(IPythonQtConsoleApp, self).__init__(*a, **kw)
+ super().__init__(*a, **kw)
# -----------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/rich_jupyter_widget.py
new/qtconsole-5.0.1/qtconsole/rich_jupyter_widget.py
--- old/qtconsole-4.7.7/qtconsole/rich_jupyter_widget.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/rich_jupyter_widget.py 2020-11-21
05:27:38.000000000 +0100
@@ -50,7 +50,7 @@
""" Create a RichJupyterWidget.
"""
kw['kind'] = 'rich'
- super(RichJupyterWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# Configure the ConsoleWidget HTML exporter for our formats.
self._html_exporter.image_tag = self._get_image_tag
@@ -75,7 +75,7 @@
to the export running.
"""
self._svg_warning_displayed = False
- super(RichJupyterWidget, self).export_html()
+ super().export_html()
#---------------------------------------------------------------------------
@@ -101,7 +101,7 @@
menu.addAction('Save SVG As...',
lambda: save_svg(svg, self._control))
else:
- menu = super(RichJupyterWidget, self)._context_menu_make(pos)
+ menu = super()._context_menu_make(pos)
return menu
#---------------------------------------------------------------------------
@@ -146,11 +146,11 @@
try:
self._append_latex(data['text/latex'], True)
except LatexError:
- return super(RichJupyterWidget,
self)._handle_display_data(msg)
+ return super()._handle_display_data(msg)
self._append_html(self.output_sep2, True)
else:
# Default back to the plain text representation.
- return super(RichJupyterWidget,
self)._handle_execute_result(msg)
+ return super()._handle_execute_result(msg)
def _handle_display_data(self, msg):
"""Overridden to handle rich data types, like SVG."""
@@ -177,10 +177,10 @@
try:
self._append_latex(data['text/latex'], True)
except LatexError:
- return super(RichJupyterWidget,
self)._handle_display_data(msg)
+ return super()._handle_display_data(msg)
else:
# Default back to the plain text representation.
- return super(RichJupyterWidget, self)._handle_display_data(msg)
+ return super()._handle_display_data(msg)
#---------------------------------------------------------------------------
# 'RichJupyterWidget' protected interface
@@ -415,4 +415,4 @@
def __init__(self, *a, **kw):
warn("RichIPythonWidget is deprecated, use RichJupyterWidget",
DeprecationWarning)
- super(RichIPythonWidget, self).__init__(*a, **kw)
+ super().__init__(*a, **kw)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/rich_text.py
new/qtconsole-5.0.1/qtconsole/rich_text.py
--- old/qtconsole-4.7.7/qtconsole/rich_text.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/rich_text.py 2020-11-22 00:05:25.000000000
+0100
@@ -9,8 +9,6 @@
from qtpy import QtWidgets
-from ipython_genutils import py3compat
-
#-----------------------------------------------------------------------------
# Constants
#-----------------------------------------------------------------------------
@@ -66,7 +64,7 @@
if dialog.exec_():
self.filename = dialog.selectedFiles()[0]
choice = dialog.selectedNameFilter()
- html = py3compat.cast_unicode(self.control.document().toHtml())
+ html = self.control.document().toHtml()
# Configure the exporter.
if choice.startswith('XHTML'):
@@ -177,7 +175,7 @@
# valid XML.
offset = html.find("<html>")
assert offset > -1, 'Invalid HTML string: no <html> tag.'
- html = (u'<html xmlns="http://www.w3.org/1999/xhtml">\n'+
+ html = ('<html xmlns="http://www.w3.org/1999/xhtml">\n'+
html[offset+6:])
html = fix_html(html)
@@ -206,7 +204,7 @@
format : "png"|"svg", optional [default "png"]
Format for returned or referenced images.
"""
- return u''
+ return ''
def fix_html(html):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/svg.py
new/qtconsole-5.0.1/qtconsole/svg.py
--- old/qtconsole-4.7.7/qtconsole/svg.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/svg.py 2020-11-21 05:27:38.000000000
+0100
@@ -4,8 +4,6 @@
# System library imports.
from qtpy import QtCore, QtGui, QtSvg, QtWidgets
-# Our own imports
-from ipython_genutils.py3compat import unicode_type
def save_svg(string, parent=None):
""" Prompts the user to save an SVG document to disk.
@@ -23,7 +21,7 @@
The name of the file to which the document was saved, or None if the save
was cancelled.
"""
- if isinstance(string, unicode_type):
+ if isinstance(string, str):
string = string.encode('utf-8')
dialog = QtWidgets.QFileDialog(parent, 'Save SVG Document')
@@ -48,7 +46,7 @@
string : basestring
A Python string containing a SVG document.
"""
- if isinstance(string, unicode_type):
+ if isinstance(string, str):
string = string.encode('utf-8')
mime_data = QtCore.QMimeData()
@@ -76,7 +74,7 @@
-------
A QImage of format QImage.Format_ARGB32.
"""
- if isinstance(string, unicode_type):
+ if isinstance(string, str):
string = string.encode('utf-8')
renderer = QtSvg.QSvgRenderer(QtCore.QByteArray(string))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.7.7/qtconsole/tests/test_00_console_widget.py
new/qtconsole-5.0.1/qtconsole/tests/test_00_console_widget.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_00_console_widget.py
2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/tests/test_00_console_widget.py
2020-11-21 23:57:26.000000000 +0100
@@ -1,5 +1,5 @@
-import sys
import unittest
+import sys
from flaky import flaky
import pytest
@@ -10,10 +10,7 @@
from qtconsole.qtconsoleapp import JupyterQtConsoleApp
from . import no_display
-if sys.version[0] == '2': # Python 2
- from IPython.core.inputsplitter import InputSplitter as TransformerManager
-else:
- from IPython.core.inputtransformer2 import TransformerManager
+from IPython.core.inputtransformer2 import TransformerManager
SHELL_TIMEOUT = 20000
@@ -155,10 +152,7 @@
with qtbot.waitSignal(shell.executed):
shell.execute("import time")
- if sys.version[0] == '2':
- input_function = 'raw_input'
- else:
- input_function = 'input'
+ input_function = 'input'
shell.execute("print(" + input_function + "('name: ')); time.sleep(3)")
qtbot.waitUntil(lambda: control.toPlainText().split()[-1] == 'name:')
@@ -242,9 +236,9 @@
'foo\b\nbar\n',
'foo\b\nbar\r\n',
'abc\rxyz\b\b=']
- expected_outputs = [u'x=z\u2029',
- u'foo\u2029bar\u2029',
- u'foo\u2029bar\u2029',
+ expected_outputs = ['x=z\u2029',
+ 'foo\u2029bar\u2029',
+ 'foo\u2029bar\u2029',
'x=z']
for i, text in enumerate(test_inputs):
w._insert_plain_text(cursor, text)
@@ -265,14 +259,14 @@
w._insert_html(cursor, '<a href="http://python.org">written in</a>')
obj = w._control
tip = QtWidgets.QToolTip
- self.assertEqual(tip.text(), u'')
+ self.assertEqual(tip.text(), '')
# should be somewhere else
elsewhereEvent = QMouseEvent(MouseMove, QtCore.QPoint(50,50),
noButton, noButtons, noModifiers)
w.eventFilter(obj, elsewhereEvent)
self.assertEqual(tip.isVisible(), False)
- self.assertEqual(tip.text(), u'')
+ self.assertEqual(tip.text(), '')
# should be over text
overTextEvent = QMouseEvent(MouseMove, QtCore.QPoint(1,5),
noButton, noButtons, noModifiers)
@@ -361,6 +355,7 @@
copied = app.clipboard().text()
self.assertEqual(copied, 'Header\nprompt>if:\n> pass')
+ @pytest.mark.skipif(sys.platform == 'darwin', reason="Fails on macOS")
def test_keypresses(self):
"""Test the event handling code for keypresses."""
w = ConsoleWidget()
@@ -549,7 +544,7 @@
w._handle_is_complete_reply(
dict(parent_header=dict(msg_id=msg_id),
content=dict(status="incomplete", indent="!!!")))
- self.assert_text_equal(cursor, u"thing\u2029> !!!")
+ self.assert_text_equal(cursor, "thing\u2029> !!!")
self.assertEqual(calls, [])
# test complete statement (_execute called)
@@ -562,16 +557,16 @@
content=dict(status="complete", indent="###")))
self.assertEqual(calls, [("else", False)])
calls = []
- self.assert_text_equal(cursor, u"thing\u2029> !!!else\u2029")
+ self.assert_text_equal(cursor, "thing\u2029> !!!else\u2029")
# test missing answer from is_complete
msg_id = object()
w.execute("done", interactive=True)
self.assertEqual(calls, ["done"])
calls = []
- self.assert_text_equal(cursor, u"thing\u2029> !!!else\u2029")
+ self.assert_text_equal(cursor, "thing\u2029> !!!else\u2029")
w._trigger_is_complete_callback()
- self.assert_text_equal(cursor, u"thing\u2029> !!!else\u2029\u2029> ")
+ self.assert_text_equal(cursor, "thing\u2029> !!!else\u2029\u2029> ")
# assert that late answer isn't destroying anything
w._handle_is_complete_reply(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/tests/test_comms.py
new/qtconsole-5.0.1/qtconsole/tests/test_comms.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_comms.py 2019-11-17
19:57:23.000000000 +0100
+++ new/qtconsole-5.0.1/qtconsole/tests/test_comms.py 2020-11-21
05:27:38.000000000 +0100
@@ -1,16 +1,11 @@
import time
-import sys
import unittest
-from ipython_genutils.py3compat import PY3
from jupyter_client.blocking.channels import Empty
from qtconsole.manager import QtKernelManager
-PY2 = sys.version[0] == '2'
-if PY2:
- TimeoutError = RuntimeError
class Tests(unittest.TestCase):
@@ -146,17 +141,9 @@
# Received message has a header and parent header. The parent header
has
# the info about the close message type in Python 3
- if PY3:
- assert msg['parent_header']['msg_type'] == 'comm_close'
- assert msg['msg_type'] == 'stream'
- assert msg['content']['text'] == 'close\n'
- else:
- # For some reason ipykernel notifies me that it is closing,
- # even though I closed the comm
- assert msg['header']['msg_type'] == 'comm_close'
- assert comm.comm_id == msg['content']['comm_id']
- msg = self._get_next_msg()
- assert msg['header']['msg_type'] == 'stream'
+ assert msg['parent_header']['msg_type'] == 'comm_close'
+ assert msg['msg_type'] == 'stream'
+ assert msg['content']['text'] == 'close\n'
if __name__ == "__main__":
unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.7.7/qtconsole/tests/test_completion_widget.py
new/qtconsole-5.0.1/qtconsole/tests/test_completion_widget.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_completion_widget.py
2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/tests/test_completion_widget.py
2020-11-21 05:27:38.000000000 +0100
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import os
import tempfile
import shutil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.7.7/qtconsole/tests/test_jupyter_widget.py
new/qtconsole-5.0.1/qtconsole/tests/test_jupyter_widget.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_jupyter_widget.py 2020-06-22
18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/tests/test_jupyter_widget.py 2020-11-21
23:57:26.000000000 +0100
@@ -1,8 +1,9 @@
import unittest
+import sys
import pytest
-
from qtpy import QtWidgets
+
from qtconsole.client import QtKernelClient
from qtconsole.jupyter_widget import JupyterWidget
from . import no_display
@@ -39,6 +40,8 @@
w.syntax_style = 'monokai'
self.assertEqual(w._ansi_processor.get_color(15).name(), '#ffffff')
+ @pytest.mark.skipif(not sys.platform.startswith('linux'),
+ reason="Works only on Linux")
def test_other_output(self):
""" Test displaying output from other clients.
"""
@@ -58,24 +61,24 @@
self.assertEqual(document.blockCount(), 6)
self.assertEqual(document.toPlainText(), (
- u'Header\n'
- u'\n'
- u'[other] In [1]: a = 1 + 1\n'
- u' ...: b = range(10)\n'
- u'\n'
- u'In [2]: '
+ 'Header\n'
+ '\n'
+ '[other] In [1]: a = 1 + 1\n'
+ ' ...: b = range(10)\n'
+ '\n'
+ 'In [2]: '
))
# Check proper syntax highlighting
self.assertEqual(document.toHtml(), (
- u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">\n'
- u'<html><head><meta name="qrichtext" content="1" /><style
type="text/css">\n'
- u'p, li { white-space: pre-wrap; }\n'
- u'</style></head><body style=" font-family:\'Monospace\';
font-size:9pt; font-weight:400; font-style:normal;">\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">Header</p>\n'
- u'<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0;
text-indent:0px;"><br /></p>\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
color:#000080;">[other] In [</span><span style=" font-weight:600;
color:#000080;">1</span><span style=" color:#000080;">]:</span> a = 1 + 1</p>\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
color:#000080;">\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0...:</span> b =
range(10)</p>\n'
- u'<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0;
text-indent:0px;"><br /></p>\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
color:#000080;">In [</span><span style=" font-weight:600;
color:#000080;">2</span><span style=" color:#000080;">]:</span>
</p></body></html>'
+ '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">\n'
+ '<html><head><meta name="qrichtext" content="1" /><style
type="text/css">\n'
+ 'p, li { white-space: pre-wrap; }\n'
+ '</style></head><body style=" font-family:\'Monospace\';
font-size:9pt; font-weight:400; font-style:normal;">\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">Header</p>\n'
+ '<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0;
text-indent:0px;"><br /></p>\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
color:#000080;">[other] In [</span><span style=" font-weight:600;
color:#000080;">1</span><span style=" color:#000080;">]:</span> a = 1 + 1</p>\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
color:#000080;">\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0...:</span> b =
range(10)</p>\n'
+ '<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0;
text-indent:0px;"><br /></p>\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
color:#000080;">In [</span><span style=" font-weight:600;
color:#000080;">2</span><span style=" color:#000080;">]:</span>
</p></body></html>'
))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/util.py
new/qtconsole-5.0.1/qtconsole/util.py
--- old/qtconsole-4.7.7/qtconsole/util.py 2020-06-22 18:28:02.000000000
+0200
+++ new/qtconsole-5.0.1/qtconsole/util.py 2020-11-21 05:27:38.000000000
+0100
@@ -5,7 +5,6 @@
from qtpy import QtCore, QtGui
-from ipython_genutils.py3compat import iteritems
from traitlets import HasTraits, TraitType
#-----------------------------------------------------------------------------
@@ -25,7 +24,7 @@
def __new__(mcls, name, bases, classdict):
# FIXME: this duplicates the code from MetaHasTraits.
# I don't think a super() call will help me here.
- for k,v in iteritems(classdict):
+ for k,v in iter(classdict.items()):
if isinstance(v, TraitType):
v.name = k
elif inspect.isclass(v):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole.egg-info/PKG-INFO
new/qtconsole-5.0.1/qtconsole.egg-info/PKG-INFO
--- old/qtconsole-4.7.7/qtconsole.egg-info/PKG-INFO 2020-09-03
06:02:43.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole.egg-info/PKG-INFO 2020-11-24
18:27:23.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qtconsole
-Version: 4.7.7
+Version: 5.0.1
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
@@ -9,7 +9,9 @@
License: BSD
Description: # Jupyter QtConsole
- [](https://travis-ci.org/jupyter/qtconsole)
+ 
+ 
+ 
[](https://coveralls.io/github/jupyter/qtconsole?branch=master)
[](https://qtconsole.readthedocs.io/en/stable/)
[](https://groups.google.com/forum/#!forum/jupyter)
@@ -90,11 +92,12 @@
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Requires-Python: >= 3.6
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole.egg-info/SOURCES.txt
new/qtconsole-5.0.1/qtconsole.egg-info/SOURCES.txt
--- old/qtconsole-4.7.7/qtconsole.egg-info/SOURCES.txt 2020-09-03
06:02:44.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole.egg-info/SOURCES.txt 2020-11-24
18:27:23.000000000 +0100
@@ -2,7 +2,6 @@
LICENSE
MANIFEST.in
README.md
-setup.cfg
setup.py
docs/Makefile
docs/autogen_config.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole.egg-info/requires.txt
new/qtconsole-5.0.1/qtconsole.egg-info/requires.txt
--- old/qtconsole-4.7.7/qtconsole.egg-info/requires.txt 2020-09-03
06:02:43.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole.egg-info/requires.txt 2020-11-24
18:27:23.000000000 +0100
@@ -11,7 +11,6 @@
Sphinx>=1.3
[test]
+flaky
pytest
-
-[test:python_version=="2.7"]
-mock
+pytest-qt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/setup.cfg
new/qtconsole-5.0.1/setup.cfg
--- old/qtconsole-4.7.7/setup.cfg 2020-09-03 06:02:46.000000000 +0200
+++ new/qtconsole-5.0.1/setup.cfg 2020-11-24 18:27:25.000000000 +0100
@@ -1,6 +1,3 @@
-[bdist_wheel]
-universal = 1
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.7.7/setup.py new/qtconsole-5.0.1/setup.py
--- old/qtconsole-4.7.7/setup.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/setup.py 2020-11-24 18:19:30.000000000 +0100
@@ -1,11 +1,8 @@
#!/usr/bin/env python
-# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
-from __future__ import print_function
-
# the name of the package
name = 'qtconsole'
@@ -16,8 +13,8 @@
import sys
v = sys.version_info
-if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
- error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
+if v[0] >= 3 and v[:2] < (3, 5):
+ error = "ERROR: %s requires Python version 3.6 or above." % name
print(error, file=sys.stderr)
sys.exit(1)
@@ -69,6 +66,7 @@
license = 'BSD',
platforms = "Linux, Mac OS X, Windows",
keywords = ['Interactive', 'Interpreter', 'Shell'],
+ python_requires = '>= 3.6',
install_requires = [
'traitlets',
'ipython_genutils',
@@ -80,8 +78,7 @@
'pyzmq>=17.1'
],
extras_require = {
- 'test': ['pytest'],
- 'test:python_version=="2.7"': ['mock'],
+ 'test': ['flaky', 'pytest', 'pytest-qt'],
'doc': 'Sphinx>=1.3',
},
entry_points = {
@@ -95,11 +92,11 @@
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
],
)
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives:
https://lists.opensuse.org/archives/list/[email protected]