Last active
January 8, 2016 20:40
-
-
Save brianv0/19e7ec3a61f1da3dae9a to your computer and use it in GitHub Desktop.
sconsinstaller
This file contains hidden or 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
import httplib | |
#import logging | |
#logging.basicConfig(level=logging.DEBUG) | |
#httplib.HTTPConnection.debuglevel = 1 | |
def getData( request ): | |
'''queries the database for the requested information''' | |
servername = "glast-ground.slac.stanford.edu" | |
conn = httplib.HTTPConnection( servername ) | |
conn.putrequest( 'GET', request ) | |
conn.putheader( 'Accept', 'text/html' ) | |
conn.endheaders() | |
response = conn.getresponse() | |
if response.status != 200: | |
msg = "The requested data or package was not available on the server: " | |
print msg + response.reason | |
sys.exit() | |
else: | |
data = response.read() | |
conn.close() | |
return data | |
path = "/SConsInstaller/db.jsp?function=versions&package=ScienceTools&versionType=Release" | |
print getData(path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment