View Single Post
Old 03-15-2025, 09:00 PM   #144
Majutsushi
Zealot
Majutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to beholdMajutsushi is a marvel to behold
 
Majutsushi's Avatar
 
Posts: 135
Karma: 11778
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
I'm not sure I follow. The "version_info = None" line sets a local variable in the plugin method, the "device_version_info()" method in the device driver doesn't know anything about it.

As far as I can tell from the exception and looking through the driver code a bit, the problem was that the eject() method in the driver set "self._device_version_info" and "self._main_prefix" to None when ejecting, and when the plugin called the device_version_info() method that method tried to reconstruct the version info, but because self._main_prefix was None it failed. The most recent change that fixed it removed the part that set self._device_version_info to None, so the device_version_info() method was able to return that without having to use the self._main_prefix variable.

This still seems a bit brittle to me, but I'm not sure the plugin can do anything about it. The right thing to do would be for the device_version_info() method in the driver to better handle the case where self._main_prefix is None.
Majutsushi is offline   Reply With Quote