From ded43b3994d85517ec01090f412de75f89354b4b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 8 Dec 2003 04:46:41 +0000 Subject: [PATCH] We now sanity-check against the API version. --- freshmeat-submit | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/freshmeat-submit b/freshmeat-submit index 0afa25c..477b31d 100755 --- a/freshmeat-submit +++ b/freshmeat-submit @@ -2,6 +2,10 @@ # # meathook -- script transactions with the Freshmeat server +# This is how we sanity-check against the XML-RPC API version. +required_major = "0" +required_minor = "2" + import sys def error(m): @@ -47,6 +51,11 @@ class FreshmeatSession: {"username":login, "password":password}) self.sid = response['SID'] self.lifetime = response['Lifetime'] + api_version = response['API Version'] + # Sanity-check against the version + (major, minor) = api_version.split(".") + if major != required_major or minor < required_minor: + LiftException("this version is out of date; get a replacement from Freshmeat.") if self.verbose: print "Session ID = %s, lifetime = %s" % (self.sid, self.lifetime) -- 2.43.0