Created
November 18, 2011 15:22
-
-
Save bradland/1376728 to your computer and use it in GitHub Desktop.
Print POW config
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
#!/usr/bin/env python | |
############################################################################# | |
# Print POW config with nice formatting ##################################### | |
# | |
# Works as is with Python 2.6. For Python 2.7, 'import simplejson as json' | |
# instead. Save this file to a location in your PATH and make sure it is | |
# executable. Then you can call 'powconfig' from anywhere and see the active | |
# POW configuration. | |
############################################################################# | |
import sys | |
import json as json | |
import httplib as http | |
conn = http.HTTPConnection("localhost") | |
conn.request("GET", "/config.json", '', {"Host":"pow"}) | |
resp = conn.getresponse() | |
data = resp.read() | |
print json.dumps(json.loads(data), indent=4) | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment