Things look slightly more legit...

This commit is contained in:
Jeppe Klitgaard committed 2015-04-06 15:27:42 +02:00
1 parent eef23e2023
commit fde8286e7e
3 files changed
+9 -6

No files matched your search

+4 -4
View File
@@ -18,7 +18,7 @@ class Profile(object):
See: `<http://wiki.vg/Authentication>`_ See: `<http://wiki.vg/Authentication>`_
""" """
def __init__(self, id_=None, name=None): def __init__(self, id_=None, name=None):
self.id = id_ self.id_ = id_
self.name = name self.name = name
def to_dict(self): def to_dict(self):
@@ -26,13 +26,13 @@ class Profile(object):
Returns ``self`` in dictionary-form, which can be serialized by json. Returns ``self`` in dictionary-form, which can be serialized by json.
""" """
if self: if self:
return {"id": self.id, return {"id": self.id_,
"name": self.name} "name": self.name}
else: else:
raise AttributeError("Profile is not yet populated.") raise AttributeError("Profile is not yet populated.")
def __bool__(self): def __bool__(self):
bool_state = self.id is not None and self.name is not None bool_state = self.id_ is not None and self.name is not None
return bool_state return bool_state
# Python 2 support # Python 2 support
@@ -121,7 +121,7 @@ class AuthenticationToken(object):
self.username = username self.username = username
self.access_token = json_resp["accessToken"] self.access_token = json_resp["accessToken"]
self.client_token = json_resp["clientToken"] self.client_token = json_resp["clientToken"]
self.profile.id = json_resp["selectedProfile"]["id"] self.profile.id_ = json_resp["selectedProfile"]["id"]
self.profile.name = json_resp["selectedProfile"]["name"] self.profile.name = json_resp["selectedProfile"]["name"]
return True return True
+2 -2
View File
@@ -11,9 +11,9 @@ both Python2 and Python3 while using the same codebase.
# Hi, I'm pylint, and sometimes I act silly, at which point my programmer # Hi, I'm pylint, and sometimes I act silly, at which point my programmer
# overlords need to correct me. # overlords need to correct me.
# pylint: disable=undefined-variable # pylint: disable=undefined-variable,redefined-builtin,invalid-name
try: try:
input = raw_input input = raw_input
except NameError: except NameError:
pass pass
# pylint: enable=undefined-variable # pylint: enable=undefined-variable,redefined-builtin,invalid-name
+3
View File
@@ -0,0 +1,3 @@
"""
Contains the networking code for `pyminecraft`.
"""