comparison mergeclient.py @ 99:349d49bb69f4

Porting on python3
author Magnus Schieder <mschieder@intevation.de>
date Tue, 19 Jun 2018 15:07:56 +0200
parents 4645e50539ff
children
comparison
equal deleted inserted replaced
98:b2f96072b8d7 99:349d49bb69f4
41 r = requests.post(url, files=files) 41 r = requests.post(url, files=files)
42 42
43 if r.status_code == 200: 43 if r.status_code == 200:
44 with open(options.out, "wb") as f: 44 with open(options.out, "wb") as f:
45 f.write(r.content) 45 f.write(r.content)
46 print "OK" 46 print("OK")
47 else: 47 else:
48 print "An error has occured" 48 print("An error has occured")
49 print r.status_code, r.headers 49 print((r.status_code, r.headers))
50 print r.text 50 print((r.text))
51 sys.exit(2) 51 sys.exit(2)
52 52
53 if __name__ == "__main__": 53 if __name__ == "__main__":
54 main() 54 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)