# Here's an example of stuff to copy and paste into an interactive Python interpreter to get a connection loaded.
# Or you can load it with 'python -i interactive-mode.py'.

# Set some variables.

bmrc = "~/.bmrc"
site = "www"
bmutilspath = "./lib"

# Import everything, make a connection, and try to log in.

import json
import os
import sys
sys.path.append(os.path.expanduser(bmutilspath).rstrip("/"))
import bmutils
bmconnection = bmutils.BMClientParser(os.path.expanduser(bmrc), site)
if not bmconnection.verify_login():
  print "Could not login"
    
# At this point you can do whatever you want. Here's how to load a game, and print its info in nice JSON.

gamenumber = 3038

game = bmconnection.wrap_load_game_data(gamenumber)
json.dump(game, sys.stdout, indent=1, sort_keys=True)

@@ -66,16 +66,18 @@
 e Python
+%0A#
  interpr
@@ -157,17 +157,17 @@
 eractive
--
+_
 mode.py'
@@ -623,16 +623,18 @@
  a game,
+%0A#
  and pri
@@ -731,16 +731,22 @@
 number)%0A
+print 
 json.dum
@@ -746,16 +746,17 @@
 son.dump
+s
 (game, s

Print the JSON dump, so it's prettier.