Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions FHQFrontEndLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import requests
import uuid
import getpass
import sys

# api for work security
class FHQSecurity:
Expand Down Expand Up @@ -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 *** '
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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",
Expand Down