MCPcopy Index your code
hub / github.com/pyload/pyload / main

Function main

module/lib/MultipartPostHandler.py:117–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 https_request = http_request
116
117def main():
118 import tempfile, sys
119
120 validatorURL = "http://validator.w3.org/check"
121 opener = build_opener(MultipartPostHandler)
122
123 def validateFile(url):
124 temp = tempfile.mkstemp(suffix=".html")
125 write(temp[0], opener.open(url).read())
126 params = { "ss" : "0", # show source
127 "doctype" : "Inline",
128 "uploaded_file" : open(temp[1], "rb") }
129 print opener.open(validatorURL, params).read()
130 remove(temp[1])
131
132 if len(sys.argv[1:]) > 0:
133 for arg in sys.argv[1:]:
134 validateFile(arg)
135 else:
136 validateFile("http://www.google.com")
137
138if __name__=="__main__":
139 main()

Callers 1

Calls 1

validateFileFunction · 0.85

Tested by

no test coverage detected