fix crash in Get Books when regenerating UIC files

Current versions of PyQt seem to generate code incompatible with our
class definition:

```
Traceback (most recent call last):
  File "/home/eschwartz/git/calibre/src/calibre/gui2/actions/store.py", line 49, in do_search
    return self.search()
           ^^^^^^^^^^^^^
  File "/home/eschwartz/git/calibre/src/calibre/gui2/actions/store.py", line 55, in search
    sd = SearchDialog(self.gui, self.gui, query)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eschwartz/git/calibre/src/calibre/gui2/store/search/search.py", line 38, in __init__
    self.setupUi(self)
  File "/home/eschwartz/git/calibre/src/calibre/gui2/store/search/search_ui.py", line 84, in setupUi
    self.results_view = ResultsView(parent=self.verticalLayoutWidget)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ResultsView.__init__() got an unexpected keyword argument 'parent'
```

The issue is that arguments forwarded to the PyQt class are now being
generated using keyword arguments rather than non-keyword args. As a
direct wrapper over a class belonging to another project, we really
should forward both types just in case.
This commit is contained in:
Eli Schwartz 2023-09-27 21:53:59 -04:00
parent 8c3ff7e7aa
commit f4fe3f254d
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -39,8 +39,8 @@ class ResultsView(QTreeView):
download_requested = pyqtSignal(object) download_requested = pyqtSignal(object)
open_requested = pyqtSignal(object) open_requested = pyqtSignal(object)
def __init__(self, *args): def __init__(self, *args, **kwargs):
QTreeView.__init__(self,*args) QTreeView.__init__(self,*args, **kwargs)
self._model = Matches() self._model = Matches()
self.setModel(self._model) self.setModel(self._model)