minimal changes to allow updated gramplets in user's .gramps/plugins directory
svn: r12163
This commit is contained in:
parent
57ed71a842
commit
3cf4da5cee
@ -80,9 +80,18 @@ def register_gramplet(data_dict):
|
|||||||
base_opts = {"name":"Unnamed Gramplet",
|
base_opts = {"name":"Unnamed Gramplet",
|
||||||
"tname": _("Unnamed Gramplet"),
|
"tname": _("Unnamed Gramplet"),
|
||||||
"state":"maximized",
|
"state":"maximized",
|
||||||
|
"version":"0.0.0",
|
||||||
|
"gramps":"0.0.0",
|
||||||
"column": -1, "row": -1,
|
"column": -1, "row": -1,
|
||||||
"data": []}
|
"data": []}
|
||||||
base_opts.update(data_dict)
|
base_opts.update(data_dict)
|
||||||
|
if base_opts["name"] not in AVAILABLE_GRAMPLETS:
|
||||||
|
AVAILABLE_GRAMPLETS[base_opts["name"]] = base_opts
|
||||||
|
else: # go with highest version (or current one in case of tie)
|
||||||
|
# GRAMPS loads system plugins first
|
||||||
|
loaded_version = [int(i) for i in AVAILABLE_GRAMPLETS[base_opts["name"]]["version"].split(".")]
|
||||||
|
current_version = [int(i) for i in base_opts["version"].split(".")]
|
||||||
|
if current_version >= loaded_version:
|
||||||
AVAILABLE_GRAMPLETS[base_opts["name"]] = base_opts
|
AVAILABLE_GRAMPLETS[base_opts["name"]] = base_opts
|
||||||
|
|
||||||
def register(**data):
|
def register(**data):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user