forked from pycontribs/jenkinsapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More fixes to parameterized builds - still broken.
- Loading branch information
1 parent
a7543ee
commit e89569f
Showing
4 changed files
with
201 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
Save this file as server.py | ||
>>> python server.py 0.0.0.0 8001 | ||
serving on 0.0.0.0:8001 | ||
or simply | ||
>>> python server.py | ||
Serving on localhost:8000 | ||
You can use this to test GET and POST methods. | ||
""" | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import logging | ||
import cgi | ||
|
||
import sys | ||
|
||
|
||
|
||
PORT = 8080 | ||
I = "localhost" | ||
|
||
|
||
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
|
||
def do_GET(self): | ||
logging.warning("======= GET STARTED =======") | ||
logging.warning(self.headers) | ||
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) | ||
|
||
def do_POST(self): | ||
logging.warning("======= POST STARTED =======") | ||
logging.warning(self.headers) | ||
form = cgi.FieldStorage( | ||
fp=self.rfile, | ||
headers=self.headers, | ||
environ={'REQUEST_METHOD':'POST', | ||
'CONTENT_TYPE':self.headers['Content-Type'], | ||
}) | ||
logging.warning("======= POST VALUES =======") | ||
for item in form.list: | ||
logging.warning(item) | ||
logging.warning("\n") | ||
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) | ||
|
||
Handler = ServerHandler | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
|
||
print "Serving at: http://%(interface)s:%(port)s" % dict(interface=I or "localhost", port=PORT) | ||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters