From: Eric S. Raymond Date: Sat, 16 Oct 2010 10:28:24 +0000 (-0400) Subject: Explicit Python version check is no longer really useful. X-Git-Tag: 2.0~11 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=8af7b4fa7454adb1022fa104b5b109699d35a1f3;p=freecode-submit.git Explicit Python version check is no longer really useful. Because the json import will blow up if the Python is too old. --- diff --git a/freshmeat-submit b/freshmeat-submit index 99849aa..594386e 100755 --- a/freshmeat-submit +++ b/freshmeat-submit @@ -2,19 +2,22 @@ # # freshmeat-submit -- script transactions with the Freshmeat server -import sys, re +import sys, re, urllib2, json, netrc, email.Parser, optparse, commands -def error(m): - sys.stderr.write("freshmeat-submit: %s\n" % m) - sys.stderr.flush() - sys.exit(1) - -if sys.version[:6] < '2.2.0': - error("You must upgrade to Python 2.2.0 or better to use this code.") - -import urllib2, json, netrc, email.Parser, optparse, commands +class Update: + "Encapsulate dictionaries describing a project metadata update." + def __init__(self): + self.name = None + self.per_project = {} + self.urlassoc = [] + self.per_release = {} + def __repr__(self): + return "Project: " + self.name + "\n" + \ + "Project Data: " + `self.per_project` + "\n" + \ + "URLs: " + `self.urlassoc` + "\n" + \ + "Release Data: " + `self.per_release` + "\n" -# The API implementation is sensitive to the kind of HTTP request +# The Freshmeat API implementation is sensitive to the kind of HTTP request # method you use. The general rule is: # # Reading records: GET @@ -33,19 +36,6 @@ class FreshmeatSessionException: def __init__(self, msg): self.msg = msg -class Update: - "Encapsulate dictionaries describing a project metadata update." - def __init__(self): - self.name = None - self.per_project = {} - self.urlassoc = [] - self.per_release = {} - def __repr__(self): - return "Project: " + self.name + "\n" + \ - "Project Data: " + `self.per_project` + "\n" + \ - "URLs: " + `self.urlassoc` + "\n" + \ - "Release Data: " + `self.per_release` + "\n" - class FreshmeatSession: "Encapsulate the state of a Freshmeat API session."