Browse Source

fix broken login examples after recent changes

fix #78
pull/35/merge
Rossen Georgiev 8 years ago
parent
commit
395fddf6ce
  1. 14
      docs/user_guide.rst
  2. 1
      recipes/1.Login/diy_one_off_login.py
  3. 3
      recipes/1.Login/one_off_login.py

14
docs/user_guide.rst

@ -162,15 +162,21 @@ After that we logout.
.. code:: python
from steam import SteamClient
from steam.enums import EResult
from steam.enums.emsg import EMsg
client = SteamClient()
@client.on(EMsg.ClientVACBanStatus)
def print_vac_status(msg):
print("Number of VAC Bans: %s" % msg.body.numBans)
client.cli_login()
msg = client.wait_msg(EMsg.ClientAccountInfo)
print "Logged on as: %s" % msg.body.persona_name
print "SteamID: %s" % repr(client.steam_id)
print("Logged on as: %s" % client.user.name)
print("Community profile: %s" % client.steam_id.community_url)
print("Last logon: %s" % client.user.last_logon)
print("Last logoff: %s" % client.user.last_logoff)
print("Number of friends: %d" % len(client.friends))
client.logout()

1
recipes/1.Login/diy_one_off_login.py

@ -29,7 +29,6 @@ def auth_code_prompt(is_2fa, mismatch):
try:
client.login(**LOGON_DETAILS)
client.wait_event('logged_on')
except:
raise SystemExit

3
recipes/1.Login/one_off_login.py

@ -14,9 +14,6 @@ if result != EResult.OK:
raise SystemExit
print("-"*20)
client.wait_event('logged_on')
print("Logged on as:", client.user.name)
print("Community profile:", client.steam_id.community_url)
print("Last logon:", client.user.last_logon)

Loading…
Cancel
Save