def __init__(self, **args):
        self.exact_names = []
        self.players_restrict = []
        self.kingdom_restrict = []
        self.limit = 200
        self.debug_level = args.get('debug', 0)

        if 'p1_name' in args:
            self._add_name(args['p1_name'])
        if 'p2_name' in args:
            self._add_name(args['p2_name'])
        if 'kingdom' in args:
            self.kingdom_restrict = [card_info.sane_title(k)
                                     for k in args['kingdom'].split(',')]

        self.db_query = {}
        if self.players_restrict:
            self.db_query['players'] = {'$all': self.players_restrict}

        if self.kingdom_restrict:
            self.db_query['supply'] = {'$all': self.kingdom_restrict}
    def __init__(self, **args):
        self.exact_names = []
        self.players_restrict = []
        self.kingdom_restrict = []
        self.limit = 200
        self.debug_level = args.get('debug', 0)

        if 'p1_name' in args:
            self._add_name(args['p1_name'])
        if 'p2_name' in args:
            self._add_name(args['p2_name'])
        if 'kingdom' in args:
            self.kingdom_restrict = [
                card_info.sane_title(k) for k in args['kingdom'].split(',')
            ]

        self.db_query = {}
        if self.players_restrict:
            self.db_query['players'] = {'$all': self.players_restrict}

        if self.kingdom_restrict:
            self.db_query['supply'] = {'$all': self.kingdom_restrict}
 def str_card_index(self, card_name):
     title = card_info.sane_title(card_name)
     if title:
         return str(card_info.card_index(title))
     return ''