From 4a1ff91b575e569fd599627d897e90d924010a3a Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Fri, 5 Nov 2010 08:15:32 -0400 Subject: [PATCH] Plugins check version We should check plugin versions when loading them. If the API changes in a future version, then old plugins shouldn't work. --- libsaria/plugin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libsaria/plugin.py b/libsaria/plugin.py index 3937643a..3b49e80d 100644 --- a/libsaria/plugin.py +++ b/libsaria/plugin.py @@ -81,6 +81,13 @@ def load_plugin_rest(name, file): print "Error loading plugin: %s" % file print e + try: + if mod.check_version() == False: + print "Error: plugin %s requires a different version" % name + return + except: + print "Warning: plugin %s doesn't check versions" % name + try: globals()[name] = mod loaded[name] = mod