Skip to content
Permalink
Browse files
[plugins] Minor improvement to find_dependencies: avoid two consecuti…
…ve calls to updateAvailablePlugins(); add missing keys to Plugins dict in installer_data
  • Loading branch information
gacarrillor authored and nyalldawson committed Nov 4, 2021
1 parent 10633af commit 6d3cec6dcf5c94d6aa347fa3488a284f36463008
Showing with 9 additions and 3 deletions.
  1. +6 −1 python/pyplugin_installer/installer_data.py
  2. +3 −2 python/pyplugin_installer/plugindependencies.py
@@ -50,7 +50,7 @@
mRepositories = dict of dicts: {repoName : {"url" unicode,
"enabled" bool,
"valid" bool,
"Relay" Relay, # Relay object for transmitting signals from QPHttp with adding the repoName information
"Relay" Relay, # Relay object for transmitting signals from QPHttp with adding the repoName information
"Request" QNetworkRequest,
"xmlData" QNetworkReply,
"state" int, (0 - disabled, 1-loading, 2-loaded ok, 3-error (to be retried), 4-rejected)
@@ -78,14 +78,19 @@
"installed" boolean, # True if installed
"available" boolean, # True if available in repositories
"status" unicode, # ( not installed | new ) | ( installed | upgradeable | orphan | newer )
"status_exp" unicode, # ( not installed | new ) | ( installed | upgradeable | orphan | newer )
"error" unicode, # NULL | broken | incompatible | dependent
"error_details" unicode, # error description
"experimental" boolean, # true if experimental, false if stable
"deprecated" boolean, # true if deprecated, false if actual
"trusted" boolean, # true if trusted, false if not trusted
"version_available" unicode, # available version
"version_available_stable" unicode, # available stable version
"version_available_experimental" unicode, # available experimental version
"zip_repository" unicode, # the remote repository id
"download_url" unicode, # url for downloading the plugin
"download_url_stable" unicode, # url for downloading the plugin's stable version
"download_url_experimental" unicode, # url for downloading the plugin's experimental version
"filename" unicode, # the zip file name to be unzipped after downloaded
"downloads" unicode, # number of downloads
"average_vote" unicode, # average vote
@@ -44,12 +44,13 @@ def find_dependencies(plugin_id, plugin_data=None, plugin_deps=None, installed_p
to_upgrade = {}
not_found = {}

if plugin_deps is None:
if plugin_deps is None or installed_plugins is None:
updateAvailablePlugins()

if plugin_deps is None:
plugin_deps = get_plugin_deps(plugin_id)

if installed_plugins is None:
updateAvailablePlugins()
metadata_parser = metadataParser()
installed_plugins = {metadata_parser[k].get('general', 'name'): metadata_parser[k].get('general', 'version') for k, v in metadata_parser.items()}

0 comments on commit 6d3cec6

Please sign in to comment.