Merge branch 'master' into good
This commit is contained in:
commit
8189c5c7c3
|
@ -1867,8 +1867,10 @@ class Database:
|
||||||
,(name, site_id))
|
,(name, site_id))
|
||||||
#Get last id might be faster here.
|
#Get last id might be faster here.
|
||||||
#c.execute ("SELECT id FROM Players WHERE name=%s", (name,))
|
#c.execute ("SELECT id FROM Players WHERE name=%s", (name,))
|
||||||
tmp = [self.get_last_insert_id(c)]
|
result = self.get_last_insert_id(c)
|
||||||
return tmp[0]
|
else:
|
||||||
|
result = tmp[1]
|
||||||
|
return result
|
||||||
|
|
||||||
def insertGameTypes(self, row):
|
def insertGameTypes(self, row):
|
||||||
c = self.get_cursor()
|
c = self.get_cursor()
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#fpdb modules
|
#fpdb modules
|
||||||
import Card
|
import Card
|
||||||
|
from decimal import Decimal
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
|
@ -43,9 +44,9 @@ class DerivedStats():
|
||||||
self.handsplayers[player[1]]['totalProfit'] = 0
|
self.handsplayers[player[1]]['totalProfit'] = 0
|
||||||
self.handsplayers[player[1]]['street4Seen'] = False
|
self.handsplayers[player[1]]['street4Seen'] = False
|
||||||
self.handsplayers[player[1]]['street4Aggr'] = False
|
self.handsplayers[player[1]]['street4Aggr'] = False
|
||||||
self.handsplayers[player[1]]['wonWhenSeenStreet1'] = False
|
self.handsplayers[player[1]]['wonWhenSeenStreet1'] = 0.0
|
||||||
self.handsplayers[player[1]]['sawShowdown'] = False
|
self.handsplayers[player[1]]['sawShowdown'] = False
|
||||||
self.handsplayers[player[1]]['wonAtSD'] = False
|
self.handsplayers[player[1]]['wonAtSD'] = 0.0
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
self.handsplayers[player[1]]['street%dCalls' % i] = 0
|
self.handsplayers[player[1]]['street%dCalls' % i] = 0
|
||||||
self.handsplayers[player[1]]['street%dBets' % i] = 0
|
self.handsplayers[player[1]]['street%dBets' % i] = 0
|
||||||
|
@ -135,7 +136,7 @@ class DerivedStats():
|
||||||
#hand.players = [[seat, name, chips],[seat, name, chips]]
|
#hand.players = [[seat, name, chips],[seat, name, chips]]
|
||||||
for player in hand.players:
|
for player in hand.players:
|
||||||
self.handsplayers[player[1]]['seatNo'] = player[0]
|
self.handsplayers[player[1]]['seatNo'] = player[0]
|
||||||
self.handsplayers[player[1]]['startCash'] = player[2]
|
self.handsplayers[player[1]]['startCash'] = int(100 * Decimal(player[2]))
|
||||||
|
|
||||||
for i, street in enumerate(hand.actionStreets[2:]):
|
for i, street in enumerate(hand.actionStreets[2:]):
|
||||||
self.seen(self.hand, i+1)
|
self.seen(self.hand, i+1)
|
||||||
|
@ -155,9 +156,9 @@ class DerivedStats():
|
||||||
# Should be fine for split-pots, but won't be accurate for multi-way pots
|
# Should be fine for split-pots, but won't be accurate for multi-way pots
|
||||||
self.handsplayers[player]['rake'] = int(100* hand.rake)/len(hand.collectees)
|
self.handsplayers[player]['rake'] = int(100* hand.rake)/len(hand.collectees)
|
||||||
if self.handsplayers[player]['street1Seen'] == True:
|
if self.handsplayers[player]['street1Seen'] == True:
|
||||||
self.handsplayers[player]['wonWhenSeenStreet1'] = True
|
self.handsplayers[player]['wonWhenSeenStreet1'] = 1.0
|
||||||
if self.handsplayers[player]['sawShowdown'] == True:
|
if self.handsplayers[player]['sawShowdown'] == True:
|
||||||
self.handsplayers[player]['wonAtSD'] = True
|
self.handsplayers[player]['wonAtSD'] = 1.0
|
||||||
|
|
||||||
for player in hand.pot.committed:
|
for player in hand.pot.committed:
|
||||||
self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player]))
|
self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player]))
|
||||||
|
|
|
@ -387,6 +387,18 @@ Left-Drag to Move"
|
||||||
<location seat="8" x="0" y="181"> </location>
|
<location seat="8" x="0" y="181"> </location>
|
||||||
<location seat="9" x="70" y="53"> </location>
|
<location seat="9" x="70" y="53"> </location>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout fav_seat="6" height="547" max="10" width="794">
|
||||||
|
<location seat="1" x="698" y="69"> </location>
|
||||||
|
<location seat="2" x="716" y="243"> </location>
|
||||||
|
<location seat="3" x="699" y="301"> </location>
|
||||||
|
<location seat="4" x="456" y="391"> </location>
|
||||||
|
<location seat="5" x="338" y="369"> </location>
|
||||||
|
<location seat="6" x="98" y="363"> </location>
|
||||||
|
<location seat="7" x="15" y="242"> </location>
|
||||||
|
<location seat="8" x="11" y="55"> </location>
|
||||||
|
<location seat="9" x="341" y="30"> </location>
|
||||||
|
<location seat="10" x="562" y="8"> </location>
|
||||||
|
</layout>
|
||||||
</site>
|
</site>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2789,8 +2789,6 @@ class Sql:
|
||||||
,hp.tourneyTypeId
|
,hp.tourneyTypeId
|
||||||
,date_format(h.handStart, 'd%y%m%d')
|
,date_format(h.handStart, 'd%y%m%d')
|
||||||
"""
|
"""
|
||||||
#>>>>>>> 28ca49d592c8e706ad6ee58dd26655bcc33fc5fb:pyfpdb/SQL.py
|
|
||||||
#"""
|
|
||||||
elif db_server == 'postgresql':
|
elif db_server == 'postgresql':
|
||||||
self.query['rebuildHudCache'] = """
|
self.query['rebuildHudCache'] = """
|
||||||
INSERT INTO HudCache
|
INSERT INTO HudCache
|
||||||
|
|
|
@ -442,6 +442,7 @@ class Importer:
|
||||||
#pipe the Hands.id out to the HUD
|
#pipe the Hands.id out to the HUD
|
||||||
print "fpdb_import: sending hand to hud", hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
|
print "fpdb_import: sending hand to hud", hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
|
||||||
self.caller.pipe_to_hud.stdin.write("%s" % (hand.dbid_hands) + os.linesep)
|
self.caller.pipe_to_hud.stdin.write("%s" % (hand.dbid_hands) + os.linesep)
|
||||||
|
self.database.commit()
|
||||||
|
|
||||||
errors = getattr(hhc, 'numErrors')
|
errors = getattr(hhc, 'numErrors')
|
||||||
stored = getattr(hhc, 'numHands')
|
stored = getattr(hhc, 'numHands')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user