Skip to content

Commit

Permalink
[plugins] Minor improvement to find_dependencies: avoid two consecuti…
Browse files Browse the repository at this point in the history
…ve calls to updateAvailablePlugins(); add missing keys to Plugins dict in installer_data
  • Loading branch information
gacarrillor authored and github-actions[bot] committed Nov 4, 2021
1 parent 7ccfe8d commit e4a7c95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion python/pyplugin_installer/installer_data.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions python/pyplugin_installer/plugindependencies.py
Expand Up @@ -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()}

Expand Down

0 comments on commit e4a7c95

Please sign in to comment.