py3: also make plugin installer work

We check if versions compare favorably to the installed version, and if
it None, then we report that it can be installed. But this check always
returns None < available_version on python2, and on python3 it is a
comparison error -- so lift out the None handling to return as early as
possible.
This commit is contained in:
Eli Schwartz 2019-04-22 21:36:57 -04:00
parent eab2c99b60
commit 4fc124adb0
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -412,13 +412,12 @@ class DisplayPluginModel(QAbstractTableModel):
return (_('You must upgrade to at least calibre %s before installing this plugin') % return (_('You must upgrade to at least calibre %s before installing this plugin') %
self._get_display_version(display_plugin.calibre_required_version)+'\n\n'+ self._get_display_version(display_plugin.calibre_required_version)+'\n\n'+
_('Right-click to see more options')) _('Right-click to see more options'))
if display_plugin.installed_version is None:
return (_('You can install this plugin')+'\n\n'+
_('Right-click to see more options'))
if display_plugin.installed_version < display_plugin.available_version: if display_plugin.installed_version < display_plugin.available_version:
if display_plugin.installed_version is None: return (_('A new version of this plugin is available')+'\n\n'+
return (_('You can install this plugin')+'\n\n'+ _('Right-click to see more options'))
_('Right-click to see more options'))
else:
return (_('A new version of this plugin is available')+'\n\n'+
_('Right-click to see more options'))
return (_('This plugin is installed and up-to-date')+'\n\n'+ return (_('This plugin is installed and up-to-date')+'\n\n'+
_('Right-click to see more options')) _('Right-click to see more options'))