Merge branch 'master' of git://git.assembla.com/free_poker_tools.git

Conflicts:
	pyfpdb/Database.py
This commit is contained in:
eblade
2009-03-10 19:31:42 -04:00
4 changed files with 62 additions and 16 deletions
Executable → Regular
+13
View File
@@ -129,6 +129,19 @@ class Database:
cards[s_dict['seat_number']] = (self.convert_cards(s_dict))
return cards
def get_common_cards(self, hand):
"""Get and return the community cards for the specified hand."""
cards = {}
c = self.connection.cursor()
c.execute(self.sql.query['get_common_cards'], hand)
colnames = [desc[0] for desc in c.description]
for row in c.fetchall():
s_dict = {}
for name, val in zip(colnames, row):
s_dict[name] = val
cards['common'] = (self.convert_cards(s_dict))
return cards
def convert_cards(self, d):
ranks = ('', '', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A')
cards = ""