File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
py/test/selenium/webdriver/common Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -55,12 +55,18 @@ def do_GET(self):
55
55
"""GET method handler."""
56
56
try :
57
57
path = self .path [1 :].split ('?' )[0 ]
58
- html = open (os .path .join (HTML_ROOT , path ), 'r' , encoding = 'latin-1' )
58
+ if path [:4 ] == "page" :
59
+ html = """<html><head><title>Page{page_number}</title></head>
60
+ <body>Page number <span id=\" pageNumber\" >{page_number}</span>
61
+ <p><a href=\" ../xhtmlTest.html\" target=\" _top\" >top</a>
62
+ </body></html>""" .format (page_number = path [5 :])
63
+ else :
64
+ with open (os .path .join (HTML_ROOT , path ), 'r' , encoding = 'latin-1' ) as f :
65
+ html = f .read ().encode ('utf-8' )
59
66
self .send_response (200 )
60
67
self .send_header ('Content-type' , 'text/html' )
61
68
self .end_headers ()
62
- self .wfile .write (html .read ().encode ('utf-8' ))
63
- html .close ()
69
+ self .wfile .write (html )
64
70
except IOError :
65
71
self .send_error (404 , 'File Not Found: %s' % path )
66
72
@@ -142,5 +148,3 @@ def main(argv=None):
142
148
143
149
if __name__ == "__main__" :
144
150
main ()
145
-
146
-
You can’t perform that action at this time.
0 commit comments