Script version number is always verified

This commit is contained in:
echarp 2016-01-08 18:23:23 +01:00
parent 0c971e62a0
commit 3b44231b4b

View File

@ -380,16 +380,15 @@ if (len(sys.argv) <= 1) or sys.argv[1] == "--help":
# Check that we are running the latest version of the adl-submit # Check that we are running the latest version of the adl-submit
# script # script
if not testOutputFile: contents = StringIO.StringIO()
contents = StringIO.StringIO() curl = pycurl.Curl()
curl = pycurl.Curl() curl.setopt(curl.WRITEFUNCTION, contents.write)
curl.setopt(curl.WRITEFUNCTION, contents.write) curl.setopt (curl.URL, baseUrl + './adl-submit-latest-version')
curl.setopt (curl.URL, baseUrl + './adl-submit-latest-version') curl.perform()
curl.perform() if curl.getinfo(curl.HTTP_CODE) == 200:
if curl.getinfo(curl.HTTP_CODE) == 200: if float(contents.getvalue()) != float('3.3'):
if float(contents.getvalue()) != float('3.3'): print u"Votre script n'est plus à jour, merci de télécharger la nouvelle version à l'adresse"
print u"Votre script n'est plus à jour, merci de télécharger la nouvelle version à l'adresse" print u"%sadl-submit.py" % baseUrl
print u"%sadl-submit.py" % baseUrl sys.exit(1)
sys.exit(1)
SubmitEvent(event, testOutputFile) SubmitEvent(event, testOutputFile)