diff --git a/CHANGES.md b/CHANGES.md index 3727a6b..2b70bbc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ This release brings some breaking changes +- Removed imports from 'steam' namespace - Replaced builtin CM server list with automatic discovery via WebAPI or DNS - Removed `steam.client.mixins` package - Renamed `medium` param to `backend` on `SteamAuthenticator` diff --git a/docs/user_guide.rst b/docs/user_guide.rst index dcf1c64..3fdfe56 100644 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -21,7 +21,7 @@ Converting between representations .. code:: python - >>> from steam import SteamID + >>> from steam.steamid import SteamID >>> SteamID() SteamID(id=0, type='Invalid', universe='Invalid', instance=0) @@ -92,7 +92,7 @@ Calling an endpoint .. code:: python - >>> from steam import WebAPI + >>> from steam.steamid import WebAPI >>> api = WebAPI(key="") # instance.. @@ -161,7 +161,7 @@ After that we logout. .. code:: python - from steam import SteamClient + from steam.steamid import SteamClient from steam.enums.emsg import EMsg client = SteamClient() diff --git a/recipes/1.Login/diy_one_off_login.py b/recipes/1.Login/diy_one_off_login.py index 470a321..de60dd9 100644 --- a/recipes/1.Login/diy_one_off_login.py +++ b/recipes/1.Login/diy_one_off_login.py @@ -1,6 +1,6 @@ from __future__ import print_function from getpass import getpass -from steam import SteamClient +from steam.client import SteamClient print("One-off login recipe") diff --git a/recipes/1.Login/one_off_login.py b/recipes/1.Login/one_off_login.py index 97ac759..ac5ef04 100644 --- a/recipes/1.Login/one_off_login.py +++ b/recipes/1.Login/one_off_login.py @@ -1,5 +1,5 @@ from __future__ import print_function -from steam import SteamClient +from steam.client import SteamClient from steam.enums import EResult client = SteamClient() diff --git a/recipes/1.Login/persistent_login.py b/recipes/1.Login/persistent_login.py index 078d600..5e7f1ea 100644 --- a/recipes/1.Login/persistent_login.py +++ b/recipes/1.Login/persistent_login.py @@ -1,5 +1,5 @@ import logging -from steam import SteamClient +from steam.client import SteamClient from steam.enums import EResult # setup logging diff --git a/recipes/2.SimpleWebAPI/steam_worker.py b/recipes/2.SimpleWebAPI/steam_worker.py index 6608b49..760f85a 100644 --- a/recipes/2.SimpleWebAPI/steam_worker.py +++ b/recipes/2.SimpleWebAPI/steam_worker.py @@ -1,7 +1,7 @@ import logging import gevent from binascii import hexlify -from steam import SteamClient +from steam.client import SteamClient from steam.core.msg import MsgProto from steam.enums.emsg import EMsg from steam.util import proto_to_dict diff --git a/steam/__init__.py b/steam/__init__.py index 3d7bec5..30673d4 100644 --- a/steam/__init__.py +++ b/steam/__init__.py @@ -2,26 +2,3 @@ __version__ = "0.9.0" __author__ = "Rossen Georgiev" version_info = tuple(map(int, __version__.split('.'))) - -from steam.steamid import SteamID -from steam.globalid import GlobalID -from steam.webapi import WebAPI -from steam.webauth import WebAuth, MobileWebAuth - - -# proxy object -# avoids importing steam.enums.emsg unless it's needed -# avoids gevent monkey patching -class SteamClient(object): - def __new__(cls, *args, **kwargs): - from steam.client import SteamClient as SC - - bases = cls.__bases__ - - if bases != (object, ): - if bases[0] != SteamClient: - raise ValueError("SteamClient needs to be the first base for custom classes") - - SC = type("SteamClient", (SC,) + bases[1:], {}) - - return SC(*args, **kwargs) diff --git a/steam/client/__init__.py b/steam/client/__init__.py index fd34e75..776a0a3 100644 --- a/steam/client/__init__.py +++ b/steam/client/__init__.py @@ -27,7 +27,7 @@ from steam.enums.emsg import EMsg from steam.enums import EResult, EOSType, EPersonaState from steam.core.msg import MsgProto from steam.core.cm import CMClient -from steam import SteamID +from steam.steamid import SteamID from steam.client.builtins import BuiltinBase from steam.util import ip_from_int, ip_to_int, proto_fill_from_dict diff --git a/steam/client/gc.py b/steam/client/gc.py index 3a60914..000380f 100644 --- a/steam/client/gc.py +++ b/steam/client/gc.py @@ -8,7 +8,7 @@ Example implementation of Dota 2 GC client with inheritance. .. code:: python import myDotaModule - from steam import SteamClient + from steam.client import SteamClient from steam.core.msg import GCMsgHdrProto from steam.client.gc import GameCoordinator diff --git a/steam/webauth.py b/steam/webauth.py index b782624..f75898b 100644 --- a/steam/webauth.py +++ b/steam/webauth.py @@ -61,7 +61,8 @@ from getpass import getpass import six import requests -from steam import SteamID, webapi +from steam import webapi +from steam.steamid import SteamID from steam.util.web import make_requests_session, generate_session_id from steam.core.crypto import rsa_publickey, pkcs1v15_encrypt