Fix whitespace and indentation, per pep8

This commit is contained in:
Magnus Hagander
2019-01-17 20:47:43 +01:00
parent 87237f6536
commit 0883ac6423
114 changed files with 890 additions and 548 deletions

View File

@ -19,7 +19,8 @@ import httplib
import re
import HTMLParser
BOUNDARY="-=--=foobar-=--="
BOUNDARY = "-=--=foobar-=--="
def encode_multipart_formdata(fields, files):
L = []
@ -39,7 +40,8 @@ def encode_multipart_formdata(fields, files):
body = "\r\n".join(L)
return body
if __name__=="__main__":
if __name__ == "__main__":
if len(sys.argv) != 2:
print "Usage: localhtmlvalidate.py <local url>"
sys.exit(1)
@ -53,13 +55,15 @@ if __name__=="__main__":
firstline = 0
# Generate a form body
body = encode_multipart_formdata([
body = encode_multipart_formdata(
[
('charset', 'utf-8'),
('doctype', 'inline'),
('group', '0'),
('verbose', '1'),
],
[('uploaded_file', 'test.html', contents)])
],
[('uploaded_file', 'test.html', contents)]
)
# Now submit it to the w3c validator
h = httplib.HTTP("validator.w3.org")
@ -92,5 +96,3 @@ if __name__=="__main__":
print "Unknown status: %s" % headers['x-w3c-validator-status']
print headers
sys.exit(1)