Skip to content

Commit c0ae8f3

Browse files
committed
[Plugin Installer] Fix metadata description, add "about" tag, prefer remote plugin name.
1 parent 7771a9b commit c0ae8f3

File tree

3 files changed

+42
-50
lines changed

3 files changed

+42
-50
lines changed

python/pyplugin_installer/installer.py

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def exportPluginsToManager(self):
201201
"id" : key,
202202
"name" : plugin["name"],
203203
"description" : plugin["description"],
204+
"about" : plugin["about"],
204205
"category" : plugin["category"],
205206
"tags" : plugin["tags"],
206207
"changelog" : plugin["changelog"],

python/pyplugin_installer/installer_data.py

+23-34
Original file line numberDiff line numberDiff line change
@@ -49,54 +49,41 @@
4949
5050
mPlugins = dict of dicts {id : {
5151
"id" unicode # module name
52-
"name" unicode, #
53-
"description" unicode, #
52+
"name" unicode, # human readable plugin name
53+
"description" unicode, # short description of the plugin purpose only
54+
"about" unicode, # longer description: how does it work, where does it install, how to run it?
5455
"category" unicode, # will be removed?
5556
"tags" unicode, # comma separated, spaces allowed
5657
"changelog" unicode, # may be multiline
57-
"author_name" unicode, #
58-
"author_email" unicode, #
59-
"homepage" unicode, # url to a tracker site
58+
"author_name" unicode, # author name
59+
"author_email" unicode, # author email
60+
"homepage" unicode, # url to the plugin homepage
6061
"tracker" unicode, # url to a tracker site
61-
"code_repository" unicode, # url to a repository with code
62-
"version_installed" unicode, #
63-
"library" unicode, # full path to the installed library/Python module
62+
"code_repository" unicode, # url to the source code repository
63+
"version_installed" unicode, # installed instance version
64+
"library" unicode, # absolute path to the installed library / Python module
6465
"icon" unicode, # path to the first:(INSTALLED | AVAILABLE) icon
65-
"pythonic" const bool=True
66+
"pythonic" const bool=True # True if Python plugin
6667
"readonly" boolean, # True if core plugin
6768
"installed" boolean, # True if installed
6869
"available" boolean, # True if available in repositories
6970
"status" unicode, # ( not installed | new ) | ( installed | upgradeable | orphan | newer )
7071
"error" unicode, # NULL | broken | incompatible | dependent
71-
"error_details" unicode, # more details
72-
"experimental" boolean, # chosen version: experimental or stable?
73-
"version_available" unicode, # chosen version: version
74-
"zip_repository" unicode, # chosen version: the remote repository id
75-
"download_url" unicode, # chosen version: url for downloading
76-
"filename" unicode, # chosen version: the zip file to be downloaded
77-
"downloads" unicode, # chosen version: number of dowloads
78-
"average_vote" unicode, # chosen version: average vote
79-
"rating_votes" unicode, # chosen version: number of votes
80-
"stable:version_available" unicode, # stable version found in repositories
81-
"stable:download_source" unicode,
82-
"stable:download_url" unicode,
83-
"stable:filename" unicode,
84-
"stable:downloads" unicode,
85-
"stable:average_vote" unicode,
86-
"stable:rating_votes" unicode,
87-
"experimental:version_available" unicode, # experimental version found in repositories
88-
"experimental:download_source" unicode,
89-
"experimental:download_url" unicode,
90-
"experimental:filename" unicode,
91-
"experimental:downloads" unicode,
92-
"experimental:average_vote" unicode,
93-
"experimental:rating_votes" unicode
72+
"error_details" unicode, # error description
73+
"experimental" boolean, # true if experimental, false if stable
74+
"version_available" unicode, # available version
75+
"zip_repository" unicode, # the remote repository id
76+
"download_url" unicode, # url for downloading the plugin
77+
"filename" unicode, # the zip file name to be unzipped after downloaded
78+
"downloads" unicode, # number of dowloads
79+
"average_vote" unicode, # average vote
80+
"rating_votes" unicode, # number of votes
9481
}}
9582
"""
9683

9784

9885

99-
translatableAttributes = ["name", "description", "tags"]
86+
translatableAttributes = ["name", "description", "about", "tags"]
10087

10188
reposGroup = "/Qgis/plugin-repos"
10289
settingsGroup = "/Qgis/plugin-installer"
@@ -434,6 +421,7 @@ def xmlDownloaded(self):
434421
"name" : pluginNodes.item(i).toElement().attribute("name"),
435422
"version_available" : pluginNodes.item(i).toElement().attribute("version"),
436423
"description" : pluginNodes.item(i).firstChildElement("description").text().strip(),
424+
"about" : pluginNodes.item(i).firstChildElement("about").text().strip(),
437425
"author_name" : pluginNodes.item(i).firstChildElement("author_name").text().strip(),
438426
"homepage" : pluginNodes.item(i).firstChildElement("homepage").text().strip(),
439427
"download_url" : pluginNodes.item(i).firstChildElement("download_url").text().strip(),
@@ -647,6 +635,7 @@ def pluginMetadata(fct):
647635
"id" : key,
648636
"name" : pluginMetadata("name") or key,
649637
"description" : pluginMetadata("description"),
638+
"about" : pluginMetadata("about"),
650639
"icon" : icon,
651640
"category" : pluginMetadata("category"),
652641
"tags" : pluginMetadata("tags"),
@@ -739,7 +728,7 @@ def rebuild(self):
739728
if not self.mPlugins[key][attrib] and plugin[attrib]:
740729
self.mPlugins[key][attrib] = plugin[attrib]
741730
# other remote metadata is preffered:
742-
for attrib in ["name", "description", "category", "tags", "changelog", "author_name", "author_email", "homepage",
731+
for attrib in ["name", "description", "about", "category", "tags", "changelog", "author_name", "author_email", "homepage",
743732
"tracker", "code_repository", "experimental", "version_available", "zip_repository",
744733
"download_url", "filename", "downloads", "average_vote", "rating_votes"]:
745734
if not attrib in translatableAttributes:
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
PLUGIN METADATA TAGS
22
=======================================================
3-
id the key,library base name
3+
id the key; C++ library base name or Python module name
44
name human readable plugin name
5-
description
6-
icon path to installed or available icon
5+
description short description of the plugin purpose only
6+
about longer description: how does it work, where does it install, how to run it?
77
category isn't it depreciated?
88
tags comma separated, spaces allowed
99
changelog may be multiline
10-
author_name
11-
author_email
12-
homepage url
13-
tracker url
14-
code_repository url
15-
version_installed
16-
library absolute path to the installed library / module
10+
author_name author name
11+
author_email author email
12+
homepage url to the plugin homepage
13+
tracker url to a tracker site
14+
code_repository url to the source code repository
15+
version_installed installed instance version
16+
library absolute path to the installed library / Python module
17+
icon path to the first of (INSTALLED | AVAILABLE) icon
1718
pythonic true | false (is plugin pythonic or cpp?)
1819
readonly true | false (is core plugin?)
1920
installed true | false
2021
available true | false
2122
status not installed | new | upgradeable | orphan | downgradeable *
2223
error NULL | broken | incompatible | dependent
23-
error_details
24-
experimental chosen version status
25-
version_available
24+
error_details error description
25+
experimental true if experimental, false if stable
26+
version_available available version
2627
zip_repository the remote repository id
27-
download_url
28-
filename the zip file name to be unpacked
28+
download_url url for downloading the plugin
29+
filename the zip file name to be unzipped after downloaded
2930
downloads number of dowloads
30-
average_vote
31+
average_vote average vote
3132
rating_votes number of votes
3233

3334
* status is only obligatory for Pythin plugins and it must match all the tags:
3435
available, installed. version_available, version_installed.
3536
orphan = installed and not available to download;
3637
new = not installed and seen for the first time;
3738
downgradeable = the available version is lower than installed one.
39+

0 commit comments

Comments
 (0)