]> thyrsus.com Git - freecode-submit.git/commitdiff
We now sanity-check against the API version.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 8 Dec 2003 04:46:41 +0000 (04:46 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 8 Dec 2003 04:46:41 +0000 (04:46 +0000)
freshmeat-submit

index 0afa25c44fcee518a055745909f8054f83248601..477b31d93b3640c3e326c335592b16260b3d30c8 100755 (executable)
@@ -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)