From 662d2f894b3682db06533419ad3d6be40952eaa4 Mon Sep 17 00:00:00 2001 From: Free Hack Quest Date: Thu, 1 Oct 2015 09:47:26 +0000 Subject: [PATCH 1/2] fixed READNE errors --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8c47e5..7d15989 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This is console client for FreeHhackQuest game. +This is console client for FreeHackQuest-platform. You must have python 2.6.X or higher. From c7137c32d8dfe956020162b2581d90beee087d53 Mon Sep 17 00:00:00 2001 From: Free Hack Quest Date: Thu, 1 Oct 2015 10:16:15 +0000 Subject: [PATCH 2/2] fixed README.md and fixed library --- FHQFrontEndLib.py | 8 +++++--- README.md | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) 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 7d15989..480a62b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ 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",