New check for updated addons

svn: r15721
This commit is contained in:
Doug Blank 2010-08-13 06:42:14 +00:00
parent f9af188191
commit 7c6cba4fae
3 changed files with 8 additions and 5 deletions

View File

@ -127,6 +127,8 @@ register('behavior.addmedia-relative-path', False)
register('behavior.autoload', False)
register('behavior.avg-generation-gap', 20)
register('behavior.betawarn', False)
register('behavior.check-for-updates', 0)
register('behavior.last-check-for-updates', "1970/01/01")
register('behavior.database-path', os.path.join( const.HOME_DIR, 'grampsdb'))
register('behavior.date-about-range', 50)
register('behavior.date-after-range', 50)

View File

@ -249,6 +249,7 @@ def load_addon_file(path, callback=None, register_plugin=None):
# There can be multiple addons per gpr file:
for results in globals()["register_results"]:
gramps_target_version = results.get("gramps_target_version", None)
id = results.get("id", None)
if gramps_target_version:
vtup = version_str_to_tup(gramps_target_version, 2)
# Is it for the right version of gramps?
@ -256,11 +257,11 @@ def load_addon_file(path, callback=None, register_plugin=None):
# If this version is not installed, or > installed, install it
good_gpr.add(gpr_file)
if callback:
callback(" " + (_("'%s' is for this version of Gramps.") % gpr_file) + "\n")
callback(" " + (_("'%s' is for this version of Gramps.") % id) + "\n")
else:
# If the plugin is for another version; inform and do nothing
if callback:
callback(" " + (_("'%s' is NOT for this version of Gramps.") % gpr_file) + "\n")
callback(" " + (_("'%s' is NOT for this version of Gramps.") % id) + "\n")
callback(" " + (_("It is for version %d.%d" % vtup) + "\n"))
continue
else:

View File

@ -309,9 +309,9 @@ class ViewManager(CLIManager):
if (version_str_to_tup(plugin_dict["v"], 3) >
version_str_to_tup(plugin.version, 3)):
print(" Downloading '%s'..." % plugin_dict["z"])
load_addon_file("%s/download/%s" %
(SOURCEFORGE, plugin_dict["z"]),
callback=print)
#load_addon_file("%s/download/%s" %
# (SOURCEFORGE, plugin_dict["z"]),
# callback=print)
else:
print(" '%s' is ok" % plugin_dict["n"])
else: