mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
45704e36c5
commit
ccaa960edf
@ -254,7 +254,7 @@ Platforms: Windows, OSX, Linux; History: Yes;</span></i></li>
|
|||||||
return self.installed_version is not None
|
return self.installed_version is not None
|
||||||
|
|
||||||
def is_upgrade_available(self):
|
def is_upgrade_available(self):
|
||||||
return self.is_installed() and (self.installed_version < self.available_version \
|
return self.is_installed() and (self.installed_version < self.available_version
|
||||||
or self.is_deprecated)
|
or self.is_deprecated)
|
||||||
|
|
||||||
def is_valid_platform(self):
|
def is_valid_platform(self):
|
||||||
@ -317,7 +317,7 @@ class DisplayPluginModel(QAbstractTableModel):
|
|||||||
|
|
||||||
def data(self, index, role):
|
def data(self, index, role):
|
||||||
if not index.isValid():
|
if not index.isValid():
|
||||||
return NONE;
|
return NONE
|
||||||
row, col = index.row(), index.column()
|
row, col = index.row(), index.column()
|
||||||
if row < 0 or row >= self.rowCount():
|
if row < 0 or row >= self.rowCount():
|
||||||
return NONE
|
return NONE
|
||||||
@ -357,7 +357,7 @@ class DisplayPluginModel(QAbstractTableModel):
|
|||||||
else:
|
else:
|
||||||
return self._get_status_tooltip(display_plugin)
|
return self._get_status_tooltip(display_plugin)
|
||||||
elif role == Qt.ForegroundRole:
|
elif role == Qt.ForegroundRole:
|
||||||
if col != 1: # Never change colour of the donation column
|
if col != 1: # Never change colour of the donation column
|
||||||
if display_plugin.is_deprecated:
|
if display_plugin.is_deprecated:
|
||||||
return QVariant(QBrush(Qt.blue))
|
return QVariant(QBrush(Qt.blue))
|
||||||
if display_plugin.is_disabled():
|
if display_plugin.is_disabled():
|
||||||
@ -417,7 +417,7 @@ class DisplayPluginModel(QAbstractTableModel):
|
|||||||
icon_name = 'plugin_upgrade_invalid.png'
|
icon_name = 'plugin_upgrade_invalid.png'
|
||||||
else:
|
else:
|
||||||
icon_name = 'plugin_upgrade_ok.png'
|
icon_name = 'plugin_upgrade_ok.png'
|
||||||
else: # A plugin available not currently installed
|
else: # A plugin available not currently installed
|
||||||
if display_plugin.is_valid_to_install():
|
if display_plugin.is_valid_to_install():
|
||||||
icon_name = 'plugin_new_valid.png'
|
icon_name = 'plugin_new_valid.png'
|
||||||
else:
|
else:
|
||||||
@ -429,11 +429,11 @@ class DisplayPluginModel(QAbstractTableModel):
|
|||||||
return QVariant(_('This plugin has been deprecated and should be uninstalled')+'\n\n'+
|
return QVariant(_('This plugin has been deprecated and should be uninstalled')+'\n\n'+
|
||||||
_('Right-click to see more options'))
|
_('Right-click to see more options'))
|
||||||
if not display_plugin.is_valid_platform():
|
if not display_plugin.is_valid_platform():
|
||||||
return QVariant(_('This plugin can only be installed on: %s') % \
|
return QVariant(_('This plugin can only be installed on: %s') %
|
||||||
', '.join(display_plugin.platforms)+'\n\n'+
|
', '.join(display_plugin.platforms)+'\n\n'+
|
||||||
_('Right-click to see more options'))
|
_('Right-click to see more options'))
|
||||||
if numeric_version < display_plugin.calibre_required_version:
|
if numeric_version < display_plugin.calibre_required_version:
|
||||||
return QVariant(_('You must upgrade to at least Calibre %s before installing this plugin') % \
|
return QVariant(_('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 < display_plugin.available_version:
|
if display_plugin.installed_version < display_plugin.available_version:
|
||||||
@ -687,7 +687,7 @@ class PluginUpdaterDialog(SizePersistedDialog):
|
|||||||
|
|
||||||
def _install_clicked(self):
|
def _install_clicked(self):
|
||||||
display_plugin = self._selected_display_plugin()
|
display_plugin = self._selected_display_plugin()
|
||||||
if not question_dialog(self, _('Install %s')%display_plugin.name, '<p>' + \
|
if not question_dialog(self, _('Install %s')%display_plugin.name, '<p>' +
|
||||||
_('Installing plugins is a <b>security risk</b>. '
|
_('Installing plugins is a <b>security risk</b>. '
|
||||||
'Plugins can contain a virus/malware. '
|
'Plugins can contain a virus/malware. '
|
||||||
'Only install it if you got it from a trusted source.'
|
'Only install it if you got it from a trusted source.'
|
||||||
@ -886,3 +886,4 @@ class PluginUpdaterDialog(SizePersistedDialog):
|
|||||||
pt.write(raw)
|
pt.write(raw)
|
||||||
pt.close()
|
pt.close()
|
||||||
return pt.name
|
return pt.name
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user