Hello community,

here is the log from the commit of package python-qtconsole for 
openSUSE:Factory checked in at 2019-07-29 17:30:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-qtconsole (Old)
 and      /work/SRC/openSUSE:Factory/.python-qtconsole.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-qtconsole"

Mon Jul 29 17:30:51 2019 rev:3 rq:719453 version:4.5.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-qtconsole/python-qtconsole.changes        
2019-06-13 23:03:40.943375905 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-qtconsole.new.4126/python-qtconsole.changes  
    2019-07-29 17:30:51.914202843 +0200
@@ -1,0 +2,8 @@
+Mon Jul 29 02:22:01 UTC 2019 - Todd R <[email protected]>
+
+- Update to versionn 4.5.2
+  * Remove deprecation warnings in Python 3.8
+  * Improve positioning and content of completion widget.
+  * Scroll down for output from remote commands.
+
+-------------------------------------------------------------------

Old:
----
  qtconsole-4.5.1.tar.gz

New:
----
  qtconsole-4.5.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-qtconsole.spec ++++++
--- /var/tmp/diff_new_pack.Oxcx4U/_old  2019-07-29 17:30:53.138202390 +0200
+++ /var/tmp/diff_new_pack.Oxcx4U/_new  2019-07-29 17:30:53.138202390 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-qtconsole
-Version:        4.5.1
+Version:        4.5.2
 %define doc_ver 4.5.1
 Release:        0
 Summary:        Jupyter Qt console

++++++ qtconsole-4.5.1.tar.gz -> qtconsole-4.5.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/PKG-INFO new/qtconsole-4.5.2/PKG-INFO
--- old/qtconsole-4.5.1/PKG-INFO        2019-05-27 15:10:45.000000000 +0200
+++ new/qtconsole-4.5.2/PKG-INFO        2019-07-23 13:58:17.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: qtconsole
-Version: 4.5.1
+Version: 4.5.2
 Summary: Jupyter Qt console
 Home-page: http://jupyter.org
 Author: Jupyter Development Team
@@ -96,5 +96,5 @@
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Description-Content-Type: text/markdown
-Provides-Extra: test
 Provides-Extra: doc
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/docs/source/changelog.rst 
new/qtconsole-4.5.2/docs/source/changelog.rst
--- old/qtconsole-4.5.1/docs/source/changelog.rst       2019-05-27 
15:08:39.000000000 +0200
+++ new/qtconsole-4.5.2/docs/source/changelog.rst       2019-07-23 
13:54:38.000000000 +0200
@@ -3,6 +3,15 @@
 Changes in Jupyter Qt console
 =============================
 
+.. _4.5.2:
+
+`4.5.2 on GitHub <https://github.com/jupyter/qtconsole/milestones/4.5.2>`__
+
+- Remove deprecation warnings in Python 3.8
+- Improve positioning and content of completion widget.
+- Scroll down for output from remote commands.
+
+
 .. _4.5.1:
 
 `4.5.1 on GitHub <https://github.com/jupyter/qtconsole/milestones/4.5.1>`__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/_version.py 
new/qtconsole-4.5.2/qtconsole/_version.py
--- old/qtconsole-4.5.1/qtconsole/_version.py   2019-05-27 15:09:58.000000000 
+0200
+++ new/qtconsole-4.5.2/qtconsole/_version.py   2019-07-23 13:56:45.000000000 
+0200
@@ -1,2 +1,2 @@
-version_info = (4, 5, 1)
+version_info = (4, 5, 2)
 __version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/completion_html.py 
new/qtconsole-4.5.2/qtconsole/completion_html.py
--- old/qtconsole-4.5.1/qtconsole/completion_html.py    2018-08-12 
00:38:18.000000000 +0200
+++ new/qtconsole-4.5.2/qtconsole/completion_html.py    2019-07-23 
13:49:55.000000000 +0200
@@ -296,12 +296,15 @@
         r, c = self._index
         self._select_index(r, c+1)
 
-    def show_items(self, cursor, items):
+    def show_items(self, cursor, items, prefix_length=0):
         """ Shows the completion widget with 'items' at the position specified
             by 'cursor'.
         """
         if not items :
             return
+        # Move cursor to start of the prefix to replace it
+        # when a item is selected
+        cursor.movePosition(QtGui.QTextCursor.Left, n=prefix_length)
         self._start_position = cursor.position()
         self._consecutive_tab = 1
         # Calculate the number of characters available.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/completion_plain.py 
new/qtconsole-4.5.2/qtconsole/completion_plain.py
--- old/qtconsole-4.5.1/qtconsole/completion_plain.py   2015-12-20 
15:40:14.000000000 +0100
+++ new/qtconsole-4.5.2/qtconsole/completion_plain.py   2019-07-23 
13:49:55.000000000 +0200
@@ -46,7 +46,7 @@
         self._console_widget._clear_temporary_buffer()
 
 
-    def show_items(self, cursor, items):
+    def show_items(self, cursor, items, prefix_length=0):
         """ Shows the completion widget with 'items' at the position specified
             by 'cursor'.
         """
@@ -54,4 +54,7 @@
             return
         self.cancel_completion()
         strng = text.columnize(items)
+        # Move cursor to start of the prefix to replace it
+        # when a item is selected
+        cursor.movePosition(QtGui.QTextCursor.Left, n=prefix_length)
         self._console_widget._fill_temporary_buffer(cursor, strng, html=False)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/completion_widget.py 
new/qtconsole-4.5.2/qtconsole/completion_widget.py
--- old/qtconsole-4.5.1/qtconsole/completion_widget.py  2016-02-22 
21:48:13.000000000 +0100
+++ new/qtconsole-4.5.2/qtconsole/completion_widget.py  2019-07-23 
13:49:55.000000000 +0200
@@ -1,5 +1,8 @@
 """A dropdown completer widget for the qtconsole."""
 
+import os
+import sys
+
 from qtconsole.qt import QtCore, QtGui
 
 
@@ -17,7 +20,7 @@
         """
         text_edit = console_widget._control
         assert isinstance(text_edit, (QtGui.QTextEdit, QtGui.QPlainTextEdit))
-        super(CompletionWidget, self).__init__()
+        super(CompletionWidget, self).__init__(parent=console_widget)
 
         self._text_edit = text_edit
         self.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
@@ -94,15 +97,18 @@
     # 'CompletionWidget' interface
     #--------------------------------------------------------------------------
 
-    def show_items(self, cursor, items):
+    def show_items(self, cursor, items, prefix_length=0):
         """ Shows the completion widget with 'items' at the position specified
             by 'cursor'.
         """
         text_edit = self._text_edit
-        point = text_edit.cursorRect(cursor).bottomRight()
-        point = text_edit.mapToGlobal(point)
+        point = self._get_top_left_position(cursor)
         self.clear()
-        self.addItems(items)
+        for item in items:
+            list_item = QtGui.QListWidgetItem()
+            list_item.setData(QtCore.Qt.UserRole, item)
+            list_item.setText(item.split('.')[-1])
+            self.addItem(list_item)
         height = self.sizeHint().height()
         screen_rect = QtGui.QApplication.desktop().availableGeometry(self)
         if (screen_rect.size().height() + screen_rect.y() -
@@ -112,6 +118,10 @@
         w = (self.sizeHintForColumn(0) +
              self.verticalScrollBar().sizeHint().width())
         self.setGeometry(point.x(), point.y(), w, height)
+
+        # Move cursor to start of the prefix to replace it
+        # when a item is selected
+        cursor.movePosition(QtGui.QTextCursor.Left, n=prefix_length)
         self._start_position = cursor.position()
         self.setCurrentRow(0)
         self.raise_()
@@ -121,10 +131,29 @@
     # Protected interface
     #--------------------------------------------------------------------------
 
+    def _get_top_left_position(self, cursor):
+        """ Get top left position for this widget.
+        """
+        point = self._text_edit.cursorRect(cursor).center()
+        point_size = self._text_edit.font().pointSize()
+
+        if sys.platform == 'darwin':
+            delta = int((point_size * 1.20) ** 0.98)
+        elif os.name == 'nt':
+            delta = int((point_size * 1.20) ** 1.05)
+        else:
+            delta = int((point_size * 1.20) ** 0.98)
+
+        y = delta - (point_size / 2)
+        point.setY(point.y() + y)
+        point = self._text_edit.mapToGlobal(point)
+        return point
+
     def _complete_current(self):
         """ Perform the completion with the currently selected item.
         """
-        self._current_text_cursor().insertText(self.currentItem().text())
+        text = self.currentItem().data(QtCore.Qt.UserRole)
+        self._current_text_cursor().insertText(text)
         self.hide()
 
     def _current_text_cursor(self):
@@ -138,8 +167,15 @@
         return cursor
 
     def _update_current(self):
-        """ Updates the current item based on the current text.
+        """ Updates the current item based on the current text and the
+            position of the widget.
         """
+        # Update widget position
+        cursor = self._text_edit.textCursor()
+        point = self._get_top_left_position(cursor)
+        self.move(point)
+
+        # Update current item
         prefix = self._current_text_cursor().selection().toPlainText()
         if prefix:
             items = self.findItems(prefix, (QtCore.Qt.MatchStartsWith |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/console_widget.py 
new/qtconsole-4.5.2/qtconsole/console_widget.py
--- old/qtconsole-4.5.1/qtconsole/console_widget.py     2019-05-03 
11:18:26.000000000 +0200
+++ new/qtconsole-4.5.2/qtconsole/console_widget.py     2019-07-23 
13:49:55.000000000 +0200
@@ -490,7 +490,7 @@
         if self.paging == 'vsplit':
             height = height * 2 + splitwidth
 
-        return QtCore.QSize(width, height)
+        return QtCore.QSize(int(width), int(height))
 
     
#---------------------------------------------------------------------------
     # 'ConsoleWidget' public interface
@@ -944,7 +944,7 @@
 
         # Perform the insertion.
         result = insert(cursor, input, *args, **kwargs)
-
+        self._control.moveCursor(QtGui.QTextCursor.End)
         return result
 
     def _append_block(self, block_format=None, before_prompt=False):
@@ -1022,9 +1022,8 @@
                 cursor.insertText(prefix)
                 current_pos = cursor.position()
 
-            cursor.movePosition(QtGui.QTextCursor.Left, n=len(prefix))
-            self._completion_widget.show_items(cursor, items)
-
+            self._completion_widget.show_items(cursor, items,
+                                               prefix_length=len(prefix))
 
     def _fill_temporary_buffer(self, cursor, text, html=False):
         """fill the area below the active editting zone with text"""
@@ -2404,13 +2403,13 @@
             maximum = document.size().height()
             step = viewport_height
         diff = maximum - scrollbar.maximum()
-        scrollbar.setRange(0, maximum)
-        scrollbar.setPageStep(step)
+        scrollbar.setRange(0, round(maximum))
+        scrollbar.setPageStep(round(step))
 
         # Compensate for undesirable scrolling that occurs automatically due to
         # maximumBlockCount() text truncation.
         if diff < 0 and document.blockCount() == document.maximumBlockCount():
-            scrollbar.setValue(scrollbar.value() + diff)
+            scrollbar.setValue(round(scrollbar.value() + diff))
 
     def _custom_context_menu_requested(self, pos):
         """ Shows a context menu at the given QPoint (in widget coordinates).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/manager.py 
new/qtconsole-4.5.2/qtconsole/manager.py
--- old/qtconsole-4.5.1/qtconsole/manager.py    2015-12-20 15:40:14.000000000 
+0100
+++ new/qtconsole-4.5.2/qtconsole/manager.py    2019-07-23 13:49:55.000000000 
+0200
@@ -18,7 +18,7 @@
         if self._timer is None:
             self._timer = QtCore.QTimer()
             self._timer.timeout.connect(self.poll)
-        self._timer.start(self.time_to_dead * 1000)
+        self._timer.start(round(self.time_to_dead * 1000))
 
     def stop(self):
         self._timer.stop()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole/rich_jupyter_widget.py 
new/qtconsole-4.5.2/qtconsole/rich_jupyter_widget.py
--- old/qtconsole-4.5.1/qtconsole/rich_jupyter_widget.py        2018-11-09 
21:59:15.000000000 +0100
+++ new/qtconsole-4.5.2/qtconsole/rich_jupyter_widget.py        2019-07-23 
13:49:55.000000000 +0200
@@ -88,7 +88,7 @@
         format = self._control.cursorForPosition(pos).charFormat()
         name = format.stringProperty(QtGui.QTextFormat.ImageName)
         if name:
-            menu = QtGui.QMenu()
+            menu = QtGui.QMenu(self)
 
             menu.addAction('Copy Image', lambda: self._copy_image(name))
             menu.addAction('Save Image As...', lambda: self._save_image(name))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qtconsole-4.5.1/qtconsole.egg-info/PKG-INFO 
new/qtconsole-4.5.2/qtconsole.egg-info/PKG-INFO
--- old/qtconsole-4.5.1/qtconsole.egg-info/PKG-INFO     2019-05-27 
15:10:44.000000000 +0200
+++ new/qtconsole-4.5.2/qtconsole.egg-info/PKG-INFO     2019-07-23 
13:58:17.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: qtconsole
-Version: 4.5.1
+Version: 4.5.2
 Summary: Jupyter Qt console
 Home-page: http://jupyter.org
 Author: Jupyter Development Team
@@ -96,5 +96,5 @@
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Description-Content-Type: text/markdown
-Provides-Extra: test
 Provides-Extra: doc
+Provides-Extra: test



Reply via email to