diff --git a/requirements.txt b/requirements.txt index 2f02053..417f4c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -requests>=2.10.0,<3 -websocket-client==0.43.0 +requests>=2.18.3,<3 +websocket_client==0.44.0 diff --git a/screepsapi/__init__.py b/screepsapi/__init__.py index 8244d39..d815c5e 100644 --- a/screepsapi/__init__.py +++ b/screepsapi/__init__.py @@ -1,3 +1,4 @@ -from screepsapi import * +from __future__ import absolute_import +from .screepsapi import * __version__ = '0.2.0' diff --git a/screepsapi/screepsapi.py b/screepsapi/screepsapi.py index 9d7d487..bf8b0a3 100644 --- a/screepsapi/screepsapi.py +++ b/screepsapi/screepsapi.py @@ -1,19 +1,17 @@ # Copyright @dzhu, @tedivm # https://gist.github.com/dzhu/d6999d126d0182973b5c +from __future__ import print_function + from base64 import b64decode from collections import OrderedDict -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO +from io import StringIO from gzip import GzipFile import json import logging import requests import ssl -import sys import websocket import zlib @@ -30,7 +28,7 @@ def req(self, func, path, **args): try: return json.loads(r.text, object_pairs_hook=OrderedDict) except ValueError: - print ('JSON failure:', r.text) + print('JSON failure: %s' % r.text) return None def get(self, _path, **args): return self.req(requests.get, _path, params=args) @@ -238,7 +236,7 @@ def __init__(self, user, password, ptr=False, logging=False, host=None, secure=N self.user_id = None def on_error(self, ws, error): - print (error) + print(error) def on_close(self, ws): self.disconnect()