diff --git a/FHQFrontEndLib.py b/FHQFrontEndLib.py index b142876..a9d6f5b 100755 --- a/FHQFrontEndLib.py +++ b/FHQFrontEndLib.py @@ -4,6 +4,7 @@ import requests import uuid import getpass +import sys # api for work security class FHQSecurity: @@ -116,10 +117,11 @@ def sendrequest(self, path, params): r = requests.post(self.url + path, params) if r.headers['content-type'] == 'application/json': try: - resp = r.json() - except ValueError: + resp = r.json + except: print r.text - raise Exception('invalid json') + print "Unexpected error:", sys.exc_info()[0] + raise if resp['result'] == 'fail': print ' *** FAIL *** ' diff --git a/README.md b/README.md index d8c47e5..480a62b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,15 @@ -This is console client for FreeHhackQuest game. +This is console client for FreeHackQuest-platform. You must have python 2.6.X or higher. +# Installation + + For debian: `apt-get install python-requests` + +# Run + + `./console-client.py` + Main commands: "login or lin" :"login into system",