From 6b417ebdd498ac7548f5a91f321f213c81d92ddf Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 2 Jul 2010 22:17:15 +0200 Subject: [PATCH] added HandsPlayers.sitout as discussed on ML --- pyfpdb/Database.py | 3 ++- pyfpdb/DerivedStats.py | 2 ++ pyfpdb/SQL.py | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 783ce12e..86409984 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -75,7 +75,7 @@ except ImportError: use_numpy = False -DB_VERSION = 122 +DB_VERSION = 123 # Variance created as sqlite has a bunch of undefined aggregate functions. @@ -1561,6 +1561,7 @@ class Database: pids[p], pdata[p]['startCash'], pdata[p]['seatNo'], + pdata[p]['sitout'], pdata[p]['card1'], pdata[p]['card2'], pdata[p]['card3'], diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index ba0028c6..1e95d604 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: utf-8 -*- #Copyright 2008 Carl Gherardi #This program is free software: you can redistribute it and/or modify @@ -139,6 +140,7 @@ class DerivedStats(): for player in hand.players: self.handsplayers[player[1]]['seatNo'] = player[0] self.handsplayers[player[1]]['startCash'] = int(100 * Decimal(player[2])) + self.handsplayers[player[1]]['sitout'] = False #TODO: implement actual sitout detection # XXX: enumerate(list, start=x) is python 2.6 syntax; 'start' #for i, street in enumerate(hand.actionStreets[2:], start=1): diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 75355430..735135ef 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -494,6 +494,7 @@ class Sql: startCash INT NOT NULL, position CHAR(1), seatNo SMALLINT NOT NULL, + sitout BOOLEAN NOT NULL, card1 smallint NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */ card2 smallint NOT NULL, @@ -610,6 +611,7 @@ class Sql: startCash INT NOT NULL, position CHAR(1), seatNo SMALLINT NOT NULL, + sitout BOOLEAN NOT NULL, card1 smallint NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */ card2 smallint NOT NULL, @@ -725,6 +727,7 @@ class Sql: startCash INT NOT NULL, position TEXT, seatNo INT NOT NULL, + sitout BOOLEAN NOT NULL, card1 INT NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */ card2 INT NOT NULL, @@ -3748,6 +3751,7 @@ class Sql: playerId, startCash, seatNo, + sitout, card1, card2, card3, @@ -3847,7 +3851,8 @@ class Sql: %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, - %s, %s, %s, %s, %s + %s, %s, %s, %s, %s, + %s )""" if db_server == 'mysql':