Mercurial > pyntnclick
diff pyweek-upload.py @ 538:d1b86d5849a0
More pep8 cleanups
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 12:15:31 +0200 |
parents | 60c345d19daf |
children |
line wrap: on
line diff
--- a/pyweek-upload.py Sat Feb 11 12:10:58 2012 +0200 +++ b/pyweek-upload.py Sat Feb 11 12:15:31 2012 +0200 @@ -106,7 +106,7 @@ s = '%s %2d%%' % (self.info, self.num * 100. / self.total) else: s = '%s %d done' % (self.info, self.num) - sys.stdout.write(s + ' ' * (75-len(s)) + '\r') + sys.stdout.write(s + ' ' * (75 - len(s)) + '\r') sys.stdout.flush() @@ -142,7 +142,7 @@ data = mimeEncode(data) h.putrequest('POST', url) - h.putheader('Content-type', 'multipart/form-data; boundary=%s'%boundary) + h.putheader('Content-type', 'multipart/form-data; boundary=%s' % boundary) h.putheader('Content-length', str(len(data))) h.putheader('Host', server) h.endheaders() @@ -155,7 +155,7 @@ response = f.read().strip() f.close() - print '%s %s'%(errcode, errmsg) + print '%s %s' % (errcode, errmsg) if response: print response @@ -208,7 +208,7 @@ elif opt == '-c': data['content_file'] = Upload(arg) elif opt == '-e': - url = '/e/%s/oup/'%arg + url = '/e/%s/oup/' % arg elif opt == '-h': host = arg elif opt == '-P': @@ -221,4 +221,3 @@ data.update(optional) http_request(data, host, port, url) -