Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(23)  |  Call(23)  |  Derive(0)  |  Import(0)
Take a card string (Ah) and convert it to the db card code (1).

        def encodeCard(cardString):
    """Take a card string (Ah) and convert it to the db card code (1)."""
    global encodeCardList
    return encodeCardList.get(cardString, 0)
        


src/f/p/fpdb-chaz-HEAD/pyfpdb/GuiReplayer.py   fpdb-chaz(Download)
                self.gc.set_foreground(color)
                if state.gametype == 'holdem':
                    cardIndex = Card.encodeCard(player.holecards[0:2])
                    self.area.window.draw_drawable(self.gc, self.cardImages[cardIndex], 0, 0, playerx - self.cardwidth - padding / 2, playery - self.cardheight, -1, -1)
                    cardIndex = Card.encodeCard(player.holecards[3:5])
                    self.area.window.draw_drawable(self.gc, self.cardImages[cardIndex], 0, 0, playerx + padding / 2, playery - self.cardheight, -1, -1)
                elif state.gametype in ('omahahi', 'omahahilo'):
                    cardIndex = Card.encodeCard(player.holecards[0:2])
                    self.area.window.draw_drawable(self.gc, self.cardImages[cardIndex], 0, 0, playerx - 2 * self.cardwidth - 3 * padding / 2, playery - self.cardheight, -1, -1)
                    cardIndex = Card.encodeCard(player.holecards[3:5])
                    cardIndex = Card.encodeCard(player.holecards[3:5])
                    self.area.window.draw_drawable(self.gc, self.cardImages[cardIndex], 0, 0, playerx - self.cardwidth - padding / 2, playery - self.cardheight, -1, -1)
                    cardIndex = Card.encodeCard(player.holecards[6:8])
                    self.area.window.draw_drawable(self.gc, self.cardImages[cardIndex], 0, 0, playerx + padding / 2, playery - self.cardheight, -1, -1)
                    cardIndex = Card.encodeCard(player.holecards[9:11])

src/f/p/fpdb-HEAD/pyfpdb/DerivedStats.py   fpdb(Download)
            boardcards += hand.board[street]
        boardcards += [u'0x', u'0x', u'0x', u'0x', u'0x']
        cards = [Card.encodeCard(c) for c in boardcards[0:5]]
        self.hands['boardcard1'] = cards[0]
        self.hands['boardcard2'] = cards[1]
                    boardcards += hand.board[street_i]
            boardcards = [u'0x', u'0x', u'0x', u'0x', u'0x'] + boardcards
            cards = [Card.encodeCard(c) for c in boardcards[-5:]]
            self.hands['boards'] += [[boardId] + cards]
 
            #    self.handsplayers[player[1]]['card%s' % i] = Card.encodeCard(card)
            for i, card in enumerate(hcs[:20]):
                self.handsplayers[player[1]]['card%s' % (i+1)] = Card.encodeCard(card)
            self.handsplayers[player[1]]['startCards'] = Card.calcStartCards(hand, player[1])
 

src/f/p/fpdb-chaz-HEAD/pyfpdb/GuiHandViewer.py   fpdb-chaz(Download)
    coldata = coldata.replace(",","")
    #print "DEBUG: coldata: %s" % (coldata)
    cards = [Card.encodeCard(c) for c in coldata.split(' ')]
    n_cards = len(cards)
 

src/f/p/fpdb-grindi-HEAD/pyfpdb/DerivedStats.py   fpdb-grindi(Download)
            boardcards += hand.board[street]
        boardcards += [u'0x', u'0x', u'0x', u'0x', u'0x']
        cards = [Card.encodeCard(c) for c in boardcards[0:5]]
        self.hands['boardcard1'] = cards[0]
        self.hands['boardcard2'] = cards[1]
            #    self.handsplayers[player[1]]['card%s' % i] = Card.encodeCard(card)
            for i, card in enumerate(hcs[:7]):
                self.handsplayers[player[1]]['card%s' % (i+1)] = Card.encodeCard(card)
            self.handsplayers[player[1]]['startCards'] = Card.calcStartCards(hand, player[1])
 

src/f/p/fpdb-sql-HEAD/pyfpdb/DerivedStats.py   fpdb-sql(Download)
            boardcards += hand.board[street]
        boardcards += [u'0x', u'0x', u'0x', u'0x', u'0x']
        cards = [Card.encodeCard(c) for c in boardcards[0:5]]
        self.hands['boardcard1'] = cards[0]
        self.hands['boardcard2'] = cards[1]
            #    self.handsplayers[player[1]]['card%s' % i] = Card.encodeCard(card)
            for i, card in enumerate(hcs[:7]):
                self.handsplayers[player[1]]['card%s' % (i+1)] = Card.encodeCard(card)
            self.handsplayers[player[1]]['startCards'] = Card.calcStartCards(hand, player[1])
 

src/f/p/fpdb-chaz-HEAD/pyfpdb/DerivedStats.py   fpdb-chaz(Download)
            boardcards += hand.board[street]
        boardcards += [u'0x', u'0x', u'0x', u'0x', u'0x']
        cards = [Card.encodeCard(c) for c in boardcards[0:5]]
        self.hands['boardcard1'] = cards[0]
        self.hands['boardcard2'] = cards[1]
                    boardcards += hand.board[street_i]
            boardcards = [u'0x', u'0x', u'0x', u'0x', u'0x'] + boardcards
            cards = [Card.encodeCard(c) for c in boardcards[-5:]]
            self.hands['boards'] += [[boardId] + cards]
 

src/f/p/fpdb-grindi-HEAD/pyfpdb/AlchemyFacilities.py   fpdb-grindi(Download)
    def process_bind_param(self, value, dialect):
        if value is None or isinstance(value, int):
            return value
        elif isinstance(value, basestring) and len(value) == 2:
            return Card.encodeCard(str(value))

src/f/p/fpdb-sql-HEAD/pyfpdb/AlchemyFacilities.py   fpdb-sql(Download)
    def process_bind_param(self, value, dialect):
        if value is None or isinstance(value, int):
            return value
        elif isinstance(value, basestring) and len(value) == 2:
            return Card.encodeCard(str(value))