def __init__(self, command_str, curr_layouts): '''Provides validation of user commands''' self.pass_cmd = False if command_str == PASS_CMD: self.pass_cmd = True self.card = None self.layout = None else: # Separate command string and pass to relevant constructor self.card = Card.create_from_user_cmd(command_str.split('L')[0]) self.layout = curr_layouts.get_layout_by_id( int(command_str.split('L')[1]) )