def load(cls, location_id): if location_id not in LOCATIONS: info = util.deserialize(r.get(location_id)) session_key = kvs.get('session_key_' + location_id) info['session_key'] = session_key location = cls(**info) LOCATIONS[location_id] = location return LOCATIONS[location_id]
def list_all(): return util.deserialize(r.get('all'))
def default_location(ctx, parsed): loc = util.deserialize(r.get('default')) loc_ref = Location(**loc) ctx.reply(parsed, location=str(loc_ref)) return True