def update_metadata(session, path=DATA_PATH):
    """Update metadata files (only ladders right now)."""
    with open(os.path.join(path, 'games.json')) as handle:
        games = json.loads(handle.read())
     
    for key, data in get_metadata(session, games).items():
        with open(os.path.join(path, '{}.json'.format(key)), 'w') as handle:
           handle.write(json.dumps(data, indent=2))
def update_metadata ( session , path = DATA_PATH ) : with open ( os . path . join ( path , 'games.json' ) ) as handle : games = json . loads ( handle . read ( ) ) for key , data in get_metadata ( session , games ) . items ( ) : with open ( os . path . join ( path , '{}.json' . format ( key ) ) , 'w' ) as handle : handle . write ( json . dumps ( data , indent = 2 ) )
Update metadata files (only ladders right now).