From f93b8178d5dfe32f9645b5a989b8b27ed756d8f6 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Fri, 5 Nov 2010 08:14:31 -0400 Subject: [PATCH] Plugins check_version() Plugins need a check_version() to return True if we are using a compatible version and False if we aren't. --- plugins/pause_after.py | 7 +++++++ plugins/web_radio.py | 8 +++++++- plugins/wm_tweaks.py | 8 +++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/pause_after.py b/plugins/pause_after.py index 846de08f..82785c6d 100644 --- a/plugins/pause_after.py +++ b/plugins/pause_after.py @@ -23,3 +23,10 @@ def start(): def stop(): pass + +def check_version(): + if ocarina.__major__ != 4: + return False + if ocarina.__minor__ != 1: + return False + return True diff --git a/plugins/web_radio.py b/plugins/web_radio.py index 7f521051..78dc6ab5 100644 --- a/plugins/web_radio.py +++ b/plugins/web_radio.py @@ -41,7 +41,13 @@ def start(): children.append("Groove Shark") ocarina.add_tab("Groove Shark", groove) - def stop(): for child in children: ocarina.remove_tab(child) + +def check_version(): + if ocarina.__major__ != 4: + return False + if ocarina.__minor__ != 1: + return False + return True diff --git a/plugins/wm_tweaks.py b/plugins/wm_tweaks.py index 8fbcf1c2..92778677 100644 --- a/plugins/wm_tweaks.py +++ b/plugins/wm_tweaks.py @@ -27,6 +27,12 @@ def start(): invite("POSTLOAD", tweak_title) invite("POSTGETART", tweak_icon) - def stop(): pass + +def check_version(): + if ocarina.__major__ != 4: + return False + if ocarina.__minor__ != 1: + return False + return True