Browse Source

docs: clean up some internal refs in SteamClient

pull/41/head
Rossen Georgiev 9 years ago
parent
commit
3bc9c7c554
  1. 28
      steam/client/__init__.py

28
steam/client/__init__.py

@ -12,17 +12,17 @@ Events
| ``auth_code_required`` - either email code or 2FA code is needed for login | ``auth_code_required`` - either email code or 2FA code is needed for login
| ``logged_on`` - after successful login, client can send messages | ``logged_on`` - after successful login, client can send messages
| ``new_login_key`` - after new login key has been received and acknowledged | ``new_login_key`` - after new login key has been received and acknowledged
| :class:`EMsg <steam.enums.emsg.EMsg>` - all messages are emitted with their ``EMsg`` | :class:`.EMsg` - all messages are emitted with their :class:`.EMsg` number
.. note:: .. note::
Mixins can emitter additional events. See their docs pages for details. Mixins can emitter additional events. See their docs pages for details.
.. note:: .. note::
Additional features are located in separate submodules. All functionality from ``bultins`` is inherited by default. Additional features are located in separate submodules. All functionality from :mod:`.builtins` is inherited by default.
.. note:: .. note::
Optional features are available as ``mixins``. This allows the client to remain light yet flexible. Optional features are available as :mod:`.mixins`. This allows the client to remain light yet flexible.
""" """
import os import os
@ -85,12 +85,12 @@ class SteamClient(CMClient, BuiltinBase):
self.credential_location = path self.credential_location = path
def connect(self, *args, **kwargs): def connect(self, *args, **kwargs):
"""Attempt to establish connection, see :method:`.CMClient.connect`""" """Attempt to establish connection, see :meth:`.CMClient.connect`"""
self._bootstrap_cm_list_from_file() self._bootstrap_cm_list_from_file()
CMClient.connect(self, *args, **kwargs) CMClient.connect(self, *args, **kwargs)
def disconnect(self, *args, **kwargs): def disconnect(self, *args, **kwargs):
"""Close connection, see :method:`.CMClient.disconnect`""" """Close connection, see :meth:`.CMClient.disconnect`"""
self.logged_on = False self.logged_on = False
CMClient.disconnect(self, *args, **kwargs) CMClient.disconnect(self, *args, **kwargs)
@ -211,12 +211,12 @@ class SteamClient(CMClient, BuiltinBase):
def reconnect(self, maxdelay=30, retry=0): def reconnect(self, maxdelay=30, retry=0):
"""Implements explonential backoff delay before attempting to connect. """Implements explonential backoff delay before attempting to connect.
It is otherwise identical to calling :meth:`steam.core.cm.CMClient.connect`. It is otherwise identical to calling :meth:`.CMClient.connect`.
The delay is reset upon a successful login. The delay is reset upon a successful login.
:param maxdelay: maximum delay in seconds before connect (0-120s) :param maxdelay: maximum delay in seconds before connect (0-120s)
:type maxdelay: :class:`int` :type maxdelay: :class:`int`
:param retry: see :meth:`steam.core.cm.CMClient.connect` :param retry: see :meth:`.CMClient.connect`
:type retry: :class:`int` :type retry: :class:`int`
:return: successful connection :return: successful connection
:rtype: :class:`bool` :rtype: :class:`bool`
@ -233,7 +233,7 @@ class SteamClient(CMClient, BuiltinBase):
Send a message to CM Send a message to CM
:param message: a message instance :param message: a message instance
:type message: :class:`steam.core.msg.Msg`, :class:`steam.core.msg.MsgProto` :type message: :class:`.Msg`, :class:`.MsgProto`
""" """
if not self.connected: if not self.connected:
raise RuntimeError("Cannot send message while not connected") raise RuntimeError("Cannot send message while not connected")
@ -247,7 +247,7 @@ class SteamClient(CMClient, BuiltinBase):
Not all messages are jobs, you'll have to find out which are which Not all messages are jobs, you'll have to find out which are which
:param message: a message instance :param message: a message instance
:type message: :class:`steam.core.msg.Msg`, :class:`steam.core.msg.MsgProto` :type message: :class:`.Msg`, :class:`.MsgProto`
:return: ``jobid`` event identifier :return: ``jobid`` event identifier
:rtype: :class:`str` :rtype: :class:`str`
@ -285,13 +285,13 @@ class SteamClient(CMClient, BuiltinBase):
Not all messages are jobs, you'll have to find out which are which Not all messages are jobs, you'll have to find out which are which
:param message: a message instance :param message: a message instance
:type message: :class:`steam.core.msg.Msg`, :class:`steam.core.msg.MsgProto` :type message: :class:`.Msg`, :class:`.MsgProto`
:param timeout: (optional) seconds to wait :param timeout: (optional) seconds to wait
:type timeout: :class:`int` :type timeout: :class:`int`
:param raises: (optional) On timeout if ``False`` return ``None``, else raise ``gevent.Timeout`` :param raises: (optional) On timeout if ``False`` return ``None``, else raise ``gevent.Timeout``
:type raises: :class:`bool` :type raises: :class:`bool`
:return: response proto message :return: response proto message
:rtype: :class:`steam.core.msg.Msg`, :class:`steam.core.msg.MsgProto` :rtype: :class:`.Msg`, :class:`.MsgProto`
:raises: ``gevent.Timeout`` :raises: ``gevent.Timeout``
""" """
job_id = self.send_job(message) job_id = self.send_job(message)
@ -305,15 +305,15 @@ class SteamClient(CMClient, BuiltinBase):
Send a message to CM and wait for a defined answer. Send a message to CM and wait for a defined answer.
:param message: a message instance :param message: a message instance
:type message: :class:`steam.core.msg.Msg`, :class:`steam.core.msg.MsgProto` :type message: :class:`.Msg`, :class:`.MsgProto`
:param response_emsg: emsg to wait for :param response_emsg: emsg to wait for
:type response_emsg: :class:`steam.enums.emsg.EMsg`,:class:`int` :type response_emsg: :class:`.EMsg`,:class:`int`
:param timeout: (optional) seconds to wait :param timeout: (optional) seconds to wait
:type timeout: :class:`int` :type timeout: :class:`int`
:param raises: (optional) On timeout if ``False`` return ``None``, else raise ``gevent.Timeout`` :param raises: (optional) On timeout if ``False`` return ``None``, else raise ``gevent.Timeout``
:type raises: :class:`bool` :type raises: :class:`bool`
:return: response proto message :return: response proto message
:rtype: :class:`steam.core.msg.Msg`, :class:`steam.core.msg.MsgProto` :rtype: :class:`.Msg`, :class:`.MsgProto`
:raises: ``gevent.Timeout`` :raises: ``gevent.Timeout``
""" """
self.send(message) self.send(message)

Loading…
Cancel
Save