Merge branch 'steffen'
This commit is contained in:
commit
7056d271d6
|
@ -1371,6 +1371,7 @@ class Database:
|
||||||
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
||||||
# then drop still hangs :-( does work in some tests though??
|
# then drop still hangs :-( does work in some tests though??
|
||||||
# will leave code here for now pending further tests/enhancement ...
|
# 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'],) )
|
c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) )
|
||||||
#print "after lock, status:", c.statusmessage
|
#print "after lock, status:", c.statusmessage
|
||||||
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
#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):
|
if "does not exist" not in str(sys.exc_value):
|
||||||
print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \
|
print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \
|
||||||
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
||||||
|
c.execute("END TRANSACTION")
|
||||||
except:
|
except:
|
||||||
print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \
|
print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \
|
||||||
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
||||||
|
|
|
@ -292,7 +292,7 @@ class DerivedStats():
|
||||||
|
|
||||||
# hand.players includes people that are sitting out on some sites.
|
# hand.players includes people that are sitting out on some sites.
|
||||||
# Those that posted an ante should have been deal cards.
|
# Those that posted an ante should have been deal cards.
|
||||||
p_in = set([x[0] for x in hand.actions['BLINDSANTES']])
|
p_in = set([x[0] for x in hand.actions['BLINDSANTES']] + [x[0] for x in hand.actions['PREFLOP']])
|
||||||
|
|
||||||
for (i, street) in enumerate(hand.actionStreets):
|
for (i, street) in enumerate(hand.actionStreets):
|
||||||
actions = hand.actions[street]
|
actions = hand.actions[street]
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Everleaf(HandHistoryConverter):
|
||||||
self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P<CARDS>.*) \]$" % player_re, re.MULTILINE)
|
self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P<CARDS>.*) \]$" % player_re, re.MULTILINE)
|
||||||
# ^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P<BET>[.,\d]+) (USD|EURO|Chips)\])?
|
# ^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P<BET>[.,\d]+) (USD|EURO|Chips)\])?
|
||||||
self.re_Action = re.compile(ur"^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:[$€]?) (?P<BET>[.,\d]+)\s?(USD|EURO|Chips|)\])?" % player_re, re.MULTILINE)
|
self.re_Action = re.compile(ur"^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:[$€]?) (?P<BET>[.,\d]+)\s?(USD|EURO|Chips|)\])?" % player_re, re.MULTILINE)
|
||||||
self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P<CARDS>.*) \]$" % player_re, re.MULTILINE)
|
self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
|
||||||
self.re_CollectPot = re.compile(ur"^%s wins (?:[$€]?)\s?(?P<POT>[.\d]+) (USD|EURO|chips)(.*?\[ (?P<CARDS>.*?) \])?" % player_re, re.MULTILINE)
|
self.re_CollectPot = re.compile(ur"^%s wins (?:[$€]?)\s?(?P<POT>[.\d]+) (USD|EURO|chips)(.*?\[ (?P<CARDS>.*?) \])?" % player_re, re.MULTILINE)
|
||||||
self.re_SitsOut = re.compile(ur"^%s sits out" % player_re, re.MULTILINE)
|
self.re_SitsOut = re.compile(ur"^%s sits out" % player_re, re.MULTILINE)
|
||||||
|
|
||||||
|
|
|
@ -556,22 +556,26 @@ Left-Drag to Move"
|
||||||
|
|
||||||
<popup_windows>
|
<popup_windows>
|
||||||
<pu pu_name="default">
|
<pu pu_name="default">
|
||||||
|
<pu_stat pu_stat_name="playername"> </pu_stat>
|
||||||
|
<pu_stat pu_stat_name="totalprofit"> </pu_stat>
|
||||||
|
<pu_stat pu_stat_name="profit100"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="n"> </pu_stat>
|
<pu_stat pu_stat_name="n"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="vpip"> </pu_stat>
|
<pu_stat pu_stat_name="vpip"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="pfr"> </pu_stat>
|
<pu_stat pu_stat_name="pfr"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="three_B_0"> </pu_stat>
|
<pu_stat pu_stat_name="three_B_0"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="steal"> </pu_stat>
|
<pu_stat pu_stat_name="steal"> </pu_stat>
|
||||||
|
<pu_stat pu_stat_name="f_steal"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="f_BB_steal"> </pu_stat>
|
<pu_stat pu_stat_name="f_BB_steal"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="f_SB_steal"> </pu_stat>
|
<pu_stat pu_stat_name="f_SB_steal"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="wmsd"> </pu_stat>
|
<pu_stat pu_stat_name="wmsd"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="wtsd"> </pu_stat>
|
<pu_stat pu_stat_name="wtsd"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="WMsF"> </pu_stat>
|
<pu_stat pu_stat_name="WMsF"> </pu_stat>
|
||||||
|
<pu_stat pu_stat_name="agg_fact"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="a_freq1"> </pu_stat>
|
<pu_stat pu_stat_name="a_freq1"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="a_freq2"> </pu_stat>
|
<pu_stat pu_stat_name="a_freq2"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="a_freq3"> </pu_stat>
|
<pu_stat pu_stat_name="a_freq3"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="a_freq4"> </pu_stat>
|
<pu_stat pu_stat_name="a_freq4"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="agg_freq"> </pu_stat>
|
<pu_stat pu_stat_name="agg_freq"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="agg_fact"> </pu_stat>
|
|
||||||
<pu_stat pu_stat_name="cbet"> </pu_stat>
|
<pu_stat pu_stat_name="cbet"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="cb1"> </pu_stat>
|
<pu_stat pu_stat_name="cb1"> </pu_stat>
|
||||||
<pu_stat pu_stat_name="cb2"> </pu_stat>
|
<pu_stat pu_stat_name="cb2"> </pu_stat>
|
||||||
|
|
|
@ -79,13 +79,13 @@ class Hand(object):
|
||||||
self.fee = None # the Database code is looking for this one .. ?
|
self.fee = None # the Database code is looking for this one .. ?
|
||||||
self.level = None
|
self.level = None
|
||||||
self.mixed = None
|
self.mixed = None
|
||||||
self.speed = "Normal"
|
self.speed = None
|
||||||
self.isRebuy = False
|
self.isRebuy = None
|
||||||
self.isAddOn = False
|
self.isAddOn = None
|
||||||
self.isKO = False
|
self.isKO = None
|
||||||
self.koBounty = None
|
self.koBounty = None
|
||||||
self.isMatrix = False
|
self.isMatrix = None
|
||||||
self.isShootout = False
|
self.isShootout = None
|
||||||
self.added = None
|
self.added = None
|
||||||
self.addedCurrency = None
|
self.addedCurrency = None
|
||||||
self.tourneyComment = None
|
self.tourneyComment = None
|
||||||
|
|
|
@ -433,9 +433,9 @@ or None if we fail to get the info """
|
||||||
try:
|
try:
|
||||||
in_fh = codecs.open(self.in_path, 'r', kodec)
|
in_fh = codecs.open(self.in_path, 'r', kodec)
|
||||||
whole_file = in_fh.read()
|
whole_file = in_fh.read()
|
||||||
|
in_fh.close()
|
||||||
self.obs = whole_file[self.index:]
|
self.obs = whole_file[self.index:]
|
||||||
self.index = len(whole_file)
|
self.index = len(whole_file)
|
||||||
in_fh.close()
|
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -72,7 +72,7 @@ class PokerStars(HandHistoryConverter):
|
||||||
(Tournament\s\# # open paren of tournament info
|
(Tournament\s\# # open paren of tournament info
|
||||||
(?P<TOURNO>\d+),\s
|
(?P<TOURNO>\d+),\s
|
||||||
# here's how I plan to use LS
|
# here's how I plan to use LS
|
||||||
(?P<BUYIN>(?P<BIAMT>[%(LS)s\d\.]+)?\+?(?P<BOUNTY>[%(LS)s\d\.]+)?\+?(?P<BIRAKE>[%(LS)s\d\.]+)\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)?|Freeroll)\s+)?
|
(?P<BUYIN>(?P<BIAMT>[%(LS)s\d\.]+)?\+?(?P<BIRAKE>[%(LS)s\d\.]+)?\+?(?P<BOUNTY>[%(LS)s\d\.]+)?\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)?|Freeroll)\s+)?
|
||||||
# close paren of tournament info
|
# close paren of tournament info
|
||||||
(?P<MIXED>HORSE|8\-Game|HOSE)?\s?\(?
|
(?P<MIXED>HORSE|8\-Game|HOSE)?\s?\(?
|
||||||
(?P<GAME>Hold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s
|
(?P<GAME>Hold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s
|
||||||
|
@ -251,17 +251,26 @@ class PokerStars(HandHistoryConverter):
|
||||||
#FIXME: handle other currencies, FPP, play money
|
#FIXME: handle other currencies, FPP, play money
|
||||||
raise FpdbParseError("failed to detect currency")
|
raise FpdbParseError("failed to detect currency")
|
||||||
|
|
||||||
|
info['BIAMT'] = info['BIAMT'].strip(u'$€FPP')
|
||||||
|
|
||||||
if hand.buyinCurrency!="PSFP":
|
if hand.buyinCurrency!="PSFP":
|
||||||
hand.buyin = int(100*Decimal(info['BIAMT'][1:]))
|
if info['BOUNTY'] != None:
|
||||||
if info['BIRAKE'][0]!="$": #we have a non-bounty game
|
# There is a bounty, Which means we need to switch BOUNTY and BIRAKE values
|
||||||
info['BOUNTY']=info['BOUNTY']+info['BIRAKE'] #TODO remove this dirty dirty hack by fixing regex
|
tmp = info['BOUNTY']
|
||||||
hand.fee = int(100*Decimal(info['BOUNTY'][1:]))
|
info['BOUNTY'] = info['BIRAKE']
|
||||||
else:
|
info['BIRAKE'] = tmp
|
||||||
hand.fee = int(100*Decimal(info['BIRAKE'][1:]))
|
info['BOUNTY'] = info['BOUNTY'].strip(u'$€') # Strip here where it isn't 'None'
|
||||||
|
hand.koBounty = int(100*Decimal(info['BOUNTY']))
|
||||||
hand.isKO = True
|
hand.isKO = True
|
||||||
hand.koBounty = int(100*Decimal(info['BOUNTY'][1:]))
|
|
||||||
else:
|
else:
|
||||||
hand.buyin = int(Decimal(info[key][0:-3]))
|
hand.isKO = False
|
||||||
|
|
||||||
|
info['BIRAKE'] = info['BIRAKE'].strip(u'$€')
|
||||||
|
|
||||||
|
hand.buyin = int(100*Decimal(info['BIAMT']))
|
||||||
|
hand.fee = int(100*Decimal(info['BIRAKE']))
|
||||||
|
else:
|
||||||
|
hand.buyin = int(Decimal(info['BIAMT']))
|
||||||
hand.fee = 0
|
hand.fee = 0
|
||||||
if key == 'LEVEL':
|
if key == 'LEVEL':
|
||||||
hand.level = info[key]
|
hand.level = info[key]
|
||||||
|
|
|
@ -589,8 +589,8 @@ def agg_fact(stat_dict, player):
|
||||||
|
|
||||||
def cbet(stat_dict, player):
|
def cbet(stat_dict, player):
|
||||||
|
|
||||||
""" Flop continuation bet."""
|
""" Total continuation bet."""
|
||||||
""" Continuation bet % = (times made a continuation bet on the flop) * 100 / (number of opportunities to make a continuation bet on the flop) """
|
""" Continuation bet % = (times made a continuation bet on any street) * 100 / (number of opportunities to make a continuation bet on any street) """
|
||||||
|
|
||||||
stat = 0.0
|
stat = 0.0
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -464,8 +464,11 @@ class Importer:
|
||||||
|
|
||||||
#pipe the Hands.id out to the HUD
|
#pipe the Hands.id out to the HUD
|
||||||
for hid in to_hud:
|
for hid in to_hud:
|
||||||
|
try:
|
||||||
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" % (hid) + os.linesep)
|
self.caller.pipe_to_hud.stdin.write("%s" % (hid) + os.linesep)
|
||||||
|
except IOError, e:
|
||||||
|
log.error("Failed to send hand to HUD: %s" % e)
|
||||||
|
|
||||||
errors = getattr(hhc, 'numErrors')
|
errors = getattr(hhc, 'numErrors')
|
||||||
stored = getattr(hhc, 'numHands')
|
stored = getattr(hhc, 'numHands')
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user