From f342323d6a3eb9f9594f5f64868e85487acd3830 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 11 Feb 2010 13:45:51 +0000 Subject: [PATCH] Fixed 2-point versions; did allow any 2-point less that gramps to load-- now must match 1-point parts (3.2) svn: r14318 --- src/gen/plug/_pluginreg.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gen/plug/_pluginreg.py b/src/gen/plug/_pluginreg.py index 67722f997..503e4dcb9 100644 --- a/src/gen/plug/_pluginreg.py +++ b/src/gen/plug/_pluginreg.py @@ -142,11 +142,14 @@ def valid_plugin_version(plugin_version_string): """ dots = plugin_version_string.count(".") if dots == 1: - plugin_version = [int(n) for n in plugin_version_string.split(".", 1)] - return tuple(plugin_version) == (VERSION_TUPLE[0], VERSION_TUPLE[1]) + plugin_version = tuple([int(n) for n in + plugin_version_string.split(".", 1)]) + return plugin_version == VERSION_TUPLE[:2] elif dots == 2: - plugin_version = [int(n) for n in plugin_version_string.split(".", 2)] - return tuple(plugin_version) <= VERSION_TUPLE + plugin_version = tuple([int(n) for n in + plugin_version_string.split(".", 2)]) + return (plugin_version[:2] == VERSION_TUPLE[:2] and + plugin_version <= VERSION_TUPLE) return False class PluginData(object):