mapozyan / caps

Power Search: A full-text search plugin for Calibre
GNU General Public License v3.0
35 stars 2 forks source link

Unhandled exception: TypeError:setMaximum(self, int): argument 1 has unexpected type 'float' #8

Closed manvibharat closed 2 months ago

manvibharat commented 2 years ago

I was able get the elastic search working. When I try to index. I get this error. Any ideas to solve this issue. I am using fedora 35


calibre, version 5.33.2 ERROR: Unhandled exception: TypeError:setMaximum(self, int): argument 1 has unexpected type 'float'

calibre 5.33.2 embedded-python: False is64bit: True Linux-5.17.11-200.fc35.x86_64-x86_64-with-glibc2.34 Linux ('64bit', 'ELF') ('Linux', '5.17.11-200.fc35.x86_64', '#1 SMP PREEMPT Wed May 25 14:56:43 UTC 2022') Python 3.10.4 Interface language: None Successfully initialized third party plugins: Calibre Power Search Plugin (2, 1, 2) Traceback (most recent call last): File "calibre_plugins.caps.main", line 676, in on_reindex self._reindex() File "calibre_plugins.caps.main", line 420, in _reindex self.progress_bar.setMaximum(len(self.update_list) + len(self.delete_list) / 20) TypeError: setMaximum(self, int): argument 1 has unexpected type 'float'

manvibharat commented 2 years ago

I was able to find the source of the problem. It seems the QT libraries for Fedora are no casting float to integers. Pleas have a look here https://github.com/vinifmor/bauh/issues/198#issuecomment-971836904

manvibharat commented 2 years ago

I made the change in main.py, but I am not able to add the .zip as the plugin in calibre. I get the following error.

calibre, version 5.33.2 ERROR: Unhandled exception: InvalidPlugin:The plugin in '/home/bharatmanvi/Downloads/Calibre Power Search Plugin.2.1.2.zip' is invalid. It does not contain a top-level init.py file

calibre 5.33.2 embedded-python: False is64bit: True Linux-5.17.11-200.fc35.x86_64-x86_64-with-glibc2.34 Linux ('64bit', 'ELF') ('Linux', '5.17.11-200.fc35.x86_64', '#1 SMP PREEMPT Wed May 25 14:56:43 UTC 2022') Python 3.10.4 Interface language: None Traceback (most recent call last): File "/usr/lib64/calibre/calibre/gui2/preferences/plugins.py", line 326, in add_plugin plugin = add_plugin(path) File "/usr/lib64/calibre/calibre/customize/ui.py", line 476, in add_plugin plugin = load_plugin(path_to_zip_file) File "/usr/lib64/calibre/calibre/customize/ui.py", line 64, in load_plugin return loader.load(path_to_zip_file) File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 283, in load plugin_name = self._locate_code(zf, path_to_zip_file) File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 378, in _locate_code raise InvalidPlugin(('The plugin in %r is invalid. It does not ' calibre.customize.InvalidPlugin: The plugin in '/home/bharatmanvi/Downloads/Calibre Power Search Plugin.2.1.2.zip' is invalid. It does not contain a top-level init.py file

Please suggest something.

mapozyan commented 2 months ago

Fixed in latest version