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

This commit is contained in:
Worros 2010-08-05 12:04:14 +08:00
commit 2859948c8a
4 changed files with 14 additions and 7 deletions

View File

@ -74,7 +74,7 @@ except ImportError:
use_numpy = False
DB_VERSION = 139
DB_VERSION = 140
# Variance created as sqlite has a bunch of undefined aggregate functions.
@ -1371,6 +1371,7 @@ class Database:
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
# then drop still hangs :-( does work in some tests though??
# will leave code here for now pending further tests/enhancement ...
c.execute("BEGIN TRANSACTION")
c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) )
#print "after lock, status:", c.statusmessage
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
@ -1381,6 +1382,7 @@ class Database:
if "does not exist" not in str(sys.exc_value):
print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
c.execute("END TRANSACTION")
except:
print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))

View File

@ -79,13 +79,13 @@ class Hand(object):
self.fee = None # the Database code is looking for this one .. ?
self.level = None
self.mixed = None
self.speed = "Normal"
self.isRebuy = False
self.isAddOn = False
self.isKO = False
self.speed = None
self.isRebuy = None
self.isAddOn = None
self.isKO = None
self.koBounty = None
self.isMatrix = False
self.isShootout = False
self.isMatrix = None
self.isShootout = None
self.added = None
self.addedCurrency = None
self.tourneyComment = None

View File

@ -262,6 +262,8 @@ class PokerStars(HandHistoryConverter):
info['BOUNTY'] = info['BOUNTY'].strip(u'$€') # Strip here where it isn't 'None'
hand.koBounty = int(100*Decimal(info['BOUNTY']))
hand.isKO = True
else:
hand.isKO = False
info['BIRAKE'] = info['BIRAKE'].strip(u'$€')

View File

@ -543,6 +543,7 @@ class Sql:
position CHAR(1),
seatNo SMALLINT NOT NULL,
sitout BOOLEAN NOT NULL,
wentAllInOnStreet SMALLINT,
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,
@ -659,6 +660,7 @@ class Sql:
position CHAR(1),
seatNo SMALLINT NOT NULL,
sitout BOOLEAN NOT NULL,
wentAllInOnStreet SMALLINT,
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,
@ -774,6 +776,7 @@ class Sql:
position TEXT,
seatNo INT NOT NULL,
sitout BOOLEAN NOT NULL,
wentAllInOnStreet INT,
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,