Browse Source

added steam.client features to docs

* various other docs alterations
* moved games played under features.misc
pull/18/merge
Rossen Georgiev 9 years ago
parent
commit
637ba7a502
  1. 1
      docs/.gitignore
  2. 21
      docs/api/steam.client.features.rst
  3. 7
      docs/api/steam.client.gc.rst
  4. 13
      docs/api/steam.client.rst
  5. 11
      docs/api/steam.rst
  6. 17
      docs/index.rst
  7. 4
      docs/user_guide.rst
  8. 4
      steam/__init__.py
  9. 19
      steam/client/__init__.py
  10. 8
      steam/client/features/__init__.py
  11. 26
      steam/client/features/misc.py
  12. 4
      steam/client/features/user.py
  13. 2
      steam/client/gc.py
  14. 12
      steam/enums/common.py

1
docs/.gitignore

@ -1,3 +1,4 @@
_build
_doc _doc
_static _static
_templates _templates

21
docs/api/steam.client.features.rst

@ -0,0 +1,21 @@
steam.client.features
=====================
.. automodule:: steam.client.features
User
----
.. automodule:: steam.client.features.user
:members:
:undoc-members:
:show-inheritance:
Misc
----
.. automodule:: steam.client.features.misc
:members:
:undoc-members:
:show-inheritance:

7
docs/api/steam.client.gc.rst

@ -0,0 +1,7 @@
steam.client.gc
===============
.. automodule:: steam.client.gc
:members:
:show-inheritance:

13
docs/api/steam.client.rst

@ -1,15 +1,10 @@
steam.client steam.client
============ ============
.. automodule:: steam.client .. toctree::
:members: steam.client.features
:show-inheritance: steam.client.gc
steam.client.gc
---------------
.. automodule:: steam.client.gc .. automodule:: steam.client
:members: :members:
:show-inheritance: :show-inheritance:

11
docs/api/steam.rst

@ -1,18 +1,17 @@
steam steam
===== =====
.. automodule:: steam
:members:
:undoc-members:
:show-inheritance:
.. toctree:: .. toctree::
steam.client steam.client
steam.core steam.core
steam.enums steam.enums
steam.util steam.util
.. automodule:: steam
:members:
:undoc-members:
:show-inheritance:
steam.steamid steam.steamid
------------- -------------

17
docs/index.rst

@ -1,3 +1,5 @@
:tocdepth: 10
.. include:: global.rst .. include:: global.rst
``steam`` module documentation ``steam`` module documentation
@ -8,6 +10,8 @@
A python module for intracting with various parts of Steam_. A python module for intracting with various parts of Steam_.
Visit the `Github repository <https://github.com/ValvePython/steam>`_.
.. note:: .. note::
The module is still very much an alpha. The module is still very much an alpha.
API can change without warning API can change without warning
@ -27,22 +31,15 @@ To install the current dev version from `Github repository <https://github.com/V
pip install git+https://github.com/ValvePython/steam pip install git+https://github.com/ValvePython/steam
Contributing Contents
============ ========
Issues, suggestions, and code contributions are welcome.
Just head on to the `Github repostory <https://github.com/ValvePython/steam>`_.
Table of contents
=================
.. toctree:: .. toctree::
:maxdepth: 3 :maxdepth: 3
quick_start user_guide
api/index api/index
Indices and tables Indices and tables
================== ==================

4
docs/quick_start.rst → docs/user_guide.rst

@ -1,7 +1,7 @@
.. include:: global.rst .. include:: global.rst
Quick start User guide
*********** **********
Welcome to the quick start section. Welcome to the quick start section.
The aim here is to give you a very quick The aim here is to give you a very quick

4
steam/__init__.py

@ -1,7 +1,7 @@
__version__ = "0.6.1" __version__ = "0.6.2"
__author__ = "Rossen Georgiev" __author__ = "Rossen Georgiev"
version_info = (0, 6, 1) version_info = (0, 6, 2)
from steam.steamid import SteamID from steam.steamid import SteamID
from steam.webapi import WebAPI from steam.webapi import WebAPI

19
steam/client/__init__.py

@ -356,22 +356,3 @@ class SteamClient(EventEmitter, FeatureBase):
""" """
while True: while True:
gevent.sleep(300) gevent.sleep(300)
def games_played(self, app_ids):
"""
Set the application being played by the user
:param app_ids: a list of application ids
:type app_ids: :class:`list`
"""
if not isinstance(app_ids, list):
raise ValueError("Expected app_ids to be of type list")
app_ids = map(int, app_ids)
message = MsgProto(EMsg.ClientGamesPlayed)
GamePlayed = message.body.GamePlayed
message.body.games_played.extend(map(lambda x: GamePlayed(game_id=x), app_ids))
self.send(message)

8
steam/client/features/__init__.py

@ -1,4 +1,10 @@
class FeatureBase(object): """
All high level features of :class:`steam.client.SteamClient` are here in seperate submodules.
"""
from steam.client.features.misc import Misc
from steam.client.features.user import User
class FeatureBase(Misc, User):
""" """
This object is used as base to implement all high level functionality. This object is used as base to implement all high level functionality.
The features are seperated into submodules. The features are seperated into submodules.

26
steam/client/features/misc.py

@ -0,0 +1,26 @@
"""
Various features that don't have a category
"""
class Misc(object):
def __init__(self):
super(Misc, self).__init__()
def games_played(self, app_ids):
"""
Set the application being played by the user
:param app_ids: a list of application ids
:type app_ids: :class:`list`
"""
if not isinstance(app_ids, list):
raise ValueError("Expected app_ids to be of type list")
app_ids = map(int, app_ids)
message = MsgProto(EMsg.ClientGamesPlayed)
GamePlayed = message.body.GamePlayed
message.body.games_played.extend(map(lambda x: GamePlayed(game_id=x), app_ids))
self.send(message)

4
steam/client/features/user.py

@ -0,0 +1,4 @@
class User(object):
def __init__(self):
super(User, self).__init__()

2
steam/client/gc.py

@ -1,5 +1,5 @@
""" """
Example usage for messeages to the Dota 2 GC. Example usage for messages to the Dota 2 GC.
.. code:: python .. code:: python

12
steam/enums/common.py

@ -6,6 +6,7 @@ __all__ = [
'EType', 'EType',
'EServerType', 'EServerType',
'EOSType', 'EOSType',
'EPersonaState',
] ]
@ -257,3 +258,14 @@ class EOSType(SteamIntEnum):
WinMAX = 15 WinMAX = 15
Max = 26 Max = 26
class EPersonaState(SteamIntEnum):
Offline = 0
Online = 1
Busy = 2
Away = 3
Snooze = 4
LookingToTrade = 5
LookingToPlay = 6
Max = 7

Loading…
Cancel
Save