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

This commit is contained in:
Eric Blade 2010-09-05 17:46:45 -04:00
commit 01cb67da5f
9 changed files with 361 additions and 35 deletions

View File

@ -142,12 +142,12 @@ class GuiBulkImport():
"""returns the vbox of this thread""" """returns the vbox of this thread"""
return self.vbox return self.vbox
def __init__(self, settings, config, parent, sql = None): def __init__(self, settings, config, sql = None, parent = None):
self.settings = settings self.settings = settings
self.config = config self.config = config
self.parent = parent self.parent = parent
self.importer = fpdb_import.Importer(self, self.settings, config,parent, sql) self.importer = fpdb_import.Importer(self, self.settings, config, sql, parent)
self.vbox = gtk.VBox(False, 0) self.vbox = gtk.VBox(False, 0)
self.vbox.show() self.vbox.show()
@ -395,7 +395,7 @@ def main(argv=None):
gtk.main() gtk.main()
else: else:
#Do something useful #Do something useful
importer = fpdb_import.Importer(False,settings, config, self.parent) importer = fpdb_import.Importer(False,settings, config, None)
# importer.setDropIndexes("auto") # importer.setDropIndexes("auto")
importer.setDropIndexes(_("don't drop")) importer.setDropIndexes(_("don't drop"))
importer.setFailOnError(options.failOnError) importer.setFailOnError(options.failOnError)

View File

@ -115,7 +115,7 @@ class Pkr(HandHistoryConverter):
^%(PLYR)s(?P<ATYPE>\sbets|\schecks|\sraises|\scalls|\sfolds)(\sto)? ^%(PLYR)s(?P<ATYPE>\sbets|\schecks|\sraises|\scalls|\sfolds)(\sto)?
(\s(%(CUR)s)?(?P<BET>[.\d]+))? (\s(%(CUR)s)?(?P<BET>[.\d]+))?
""" % subst, re.MULTILINE|re.VERBOSE) """ % subst, re.MULTILINE|re.VERBOSE)
self.re_ShowdownAction = re.compile(r"^%s: shows \[(?P<CARDS>.*)\]" % player_re, re.MULTILINE) self.re_ShowdownAction = re.compile(r"^%(PLYR)s shows \[(?P<CARDS>.*)\]" % subst, re.MULTILINE)
self.re_CollectPot = re.compile(r"^%(PLYR)s wins %(CUR)s(?P<POT>[.\d]+)" % subst, re.MULTILINE) self.re_CollectPot = re.compile(r"^%(PLYR)s wins %(CUR)s(?P<POT>[.\d]+)" % subst, re.MULTILINE)
self.re_sitsOut = re.compile("^%s sits out" % player_re, re.MULTILINE) self.re_sitsOut = re.compile("^%s sits out" % player_re, re.MULTILINE)
self.re_ShownCards = re.compile("^Seat (?P<SEAT>[0-9]+): %s (\(.*\) )?(?P<SHOWED>showed|mucked) \[(?P<CARDS>.*)\].*" % player_re, re.MULTILINE) self.re_ShownCards = re.compile("^Seat (?P<SEAT>[0-9]+): %s (\(.*\) )?(?P<SHOWED>showed|mucked) \[(?P<CARDS>.*)\].*" % player_re, re.MULTILINE)
@ -354,9 +354,10 @@ class Pkr(HandHistoryConverter):
def readShowdownActions(self, hand): def readShowdownActions(self, hand):
# TODO: pick up mucks also?? # TODO: pick up mucks also??
for shows in self.re_ShowdownAction.finditer(hand.handText): for shows in self.re_ShowdownAction.finditer(hand.handText):
cards = shows.group('CARDS').split(' ') cards = shows.group('CARDS').split(' ')
#print "DEBUG: addShownCards(%s, %s)" %(cards, shows.group('PNAME'))
hand.addShownCards(cards, shows.group('PNAME')) hand.addShownCards(cards, shows.group('PNAME'))
def readCollectPot(self,hand): def readCollectPot(self,hand):

View File

@ -249,8 +249,16 @@ class PokerStarsSummary(TourneySummary):
winnings=None winnings=None
if 'TICKET' and mg['TICKET'] != None: if 'TICKET' and mg['TICKET'] != None:
print "DEBUG: TODO! fix Step ticket values" #print "Tournament Ticket Level %s" % mg['LEVEL']
print "\tWinning = Level %s" % mg['LEVEL'] step_values = {
'1' : '750', # Step 1 - $7.50 USD
'2' : '2750', # Step 2 - $27.00 USD
'3' : '8200', # Step 3 - $82.00 USD
'4' : '21500', # Step 4 - $215.00 USD
'5' : '70000', # Step 5 - $700.00 USD
'6' : '210000', # Step 6 - $2100.00 USD
}
winnings = step_values[mg['LEVEL']]
#TODO: currency, ko/addon/rebuy count -> need examples! #TODO: currency, ko/addon/rebuy count -> need examples!
#print "DEBUG: addPlayer(%s, %s, %s, %s, None, None, None)" %(rank, name, winnings, self.currency) #print "DEBUG: addPlayer(%s, %s, %s, %s, None, None, None)" %(rank, name, winnings, self.currency)

View File

@ -999,7 +999,7 @@ class fpdb:
def tab_bulk_import(self, widget, data=None): def tab_bulk_import(self, widget, data=None):
"""opens a tab for bulk importing""" """opens a tab for bulk importing"""
new_import_thread = GuiBulkImport.GuiBulkImport(self.settings, self.config, self.window, self.sql) new_import_thread = GuiBulkImport.GuiBulkImport(self.settings, self.config, self.sql, self.window)
self.threads.append(new_import_thread) self.threads.append(new_import_thread)
bulk_tab=new_import_thread.get_vbox() bulk_tab=new_import_thread.get_vbox()
self.add_and_display_tab(bulk_tab, _("Bulk Import")) self.add_and_display_tab(bulk_tab, _("Bulk Import"))

View File

@ -70,7 +70,7 @@ else:
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
class Importer: class Importer:
def __init__(self, caller, settings, config, parent, sql = None): def __init__(self, caller, settings, config, sql = None, parent = None):
"""Constructor""" """Constructor"""
self.settings = settings self.settings = settings
self.caller = caller self.caller = caller
@ -302,15 +302,13 @@ class Importer:
totpartial = 0 totpartial = 0
toterrors = 0 toterrors = 0
tottime = 0 tottime = 0
progresscount = 0
progressgoal = len(self.filelist)
ProgressDialog = ProgressBar(self.parent) #prepare progress popup window
ProgressDialog = ProgressBar(len(self.filelist), self.parent)
for file in self.filelist: for file in self.filelist:
progresscount += 1 ProgressDialog.progress_update()
ProgressDialog.progress_update(progresscount,progressgoal)
(stored, duplicates, partial, errors, ttime) = self.import_file_dict(db, file (stored, duplicates, partial, errors, ttime) = self.import_file_dict(db, file
,self.filelist[file][0], self.filelist[file][1], q) ,self.filelist[file][0], self.filelist[file][1], q)
@ -319,11 +317,12 @@ class Importer:
totpartial += partial totpartial += partial
toterrors += errors toterrors += errors
del ProgressDialog
for i in xrange( self.settings['threads'] ): for i in xrange( self.settings['threads'] ):
print _("sending finish message queue length ="), q.qsize() print _("sending finish message queue length ="), q.qsize()
db.send_finish_msg(q) db.send_finish_msg(q)
del ProgressDialog
return (totstored, totdups, totpartial, toterrors) return (totstored, totdups, totpartial, toterrors)
# end def importFiles # end def importFiles
@ -543,24 +542,62 @@ class Importer:
class ProgressBar: class ProgressBar:
"""
Popup window to show progress
Init method sets up total number of expected iterations
If no parent is passed to init, command line
mode assumed, and does not create a progress bar
"""
def __del__(self): def __del__(self):
if self.parent:
self.progress.destroy() self.progress.destroy()
def progress_update(self, fraction, sum):
progresspercent = float(fraction) / (float(sum) + 1.0) def progress_update(self):
self.pbar.set_fraction(progresspercent) if not self.parent:
self.pbar.set_text(str(fraction) + " / " + str(sum)) #nothing to do
return
def __init__(self, parent): self.fraction += 1
#update sum if fraction exceeds expected total number of iterations
if self.fraction > self.sum:
sum = self.fraction
#progress bar total set to 1 plus the number of items,to prevent it
#reaching 100% prior to processing fully completing
progress_percent = float(self.fraction) / (float(self.sum) + 1.0)
progress_text = (self.title + " "
+ str(self.fraction) + " / " + str(self.sum))
self.pbar.set_fraction(progress_percent)
self.pbar.set_text(progress_text)
def __init__(self, sum, parent):
self.parent = parent
if not self.parent:
#no parent is passed, assume this is being run from the
#command line, so return immediately
return
self.fraction = 0
self.sum = sum
self.title = _("Importing")
self.progress = gtk.Window(gtk.WINDOW_TOPLEVEL) self.progress = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.progress.set_resizable(False) self.progress.set_resizable(False)
self.progress.set_modal(True) self.progress.set_modal(True)
self.progress.set_transient_for(parent) self.progress.set_transient_for(self.parent)
self.progress.set_decorated(False) self.progress.set_decorated(True)
self.progress.set_deletable(False)
self.progress.set_title(self.title)
vbox = gtk.VBox(False, 5) vbox = gtk.VBox(False, 5)
vbox.set_border_width(10) vbox.set_border_width(10)

View File

@ -692,6 +692,7 @@
'raisedFirstIn': False, 'raisedFirstIn': False,
'rake': 0, 'rake': 0,
'sawShowdown': False, 'sawShowdown': False,
'seatNo': 8,
'sitout': False, 'sitout': False,
'startCards': 0, 'startCards': 0,
'startCash': 925, 'startCash': 925,

View File

@ -186,8 +186,8 @@
'wonWhenSeenStreet2': 0.0, 'wonWhenSeenStreet2': 0.0,
'wonWhenSeenStreet3': 0.0, 'wonWhenSeenStreet3': 0.0,
'wonWhenSeenStreet4': 0.0}, 'wonWhenSeenStreet4': 0.0},
u'Player3': { 'card1': 0, u'Player3': { 'card1': 1,
'card2': 0, 'card2': 15,
'card3': 0, 'card3': 0,
'card4': 0, 'card4': 0,
'card5': 0, 'card5': 0,
@ -220,11 +220,11 @@
'position': 0, 'position': 0,
'raiseFirstInChance': False, 'raiseFirstInChance': False,
'raisedFirstIn': False, 'raisedFirstIn': False,
'rake': 0, 'rake': 40,
'sawShowdown': True, 'sawShowdown': True,
'seatNo': 3, 'seatNo': 3,
'sitout': False, 'sitout': False,
'startCards': 0, 'startCards': 2,
'startCash': 180, 'startCash': 180,
'street0Aggr': False, 'street0Aggr': False,
'street0Bets': 0, 'street0Bets': 0,
@ -271,7 +271,7 @@
'street4CheckCallRaiseDone': False, 'street4CheckCallRaiseDone': False,
'street4Raises': 0, 'street4Raises': 0,
'street4Seen': False, 'street4Seen': False,
'totalProfit': -159, 'totalProfit': 219,
'tourneyTypeId': None, 'tourneyTypeId': None,
'tourneysPlayersIds': None, 'tourneysPlayersIds': None,
'winnings': 0, 'winnings': 0,
@ -280,8 +280,8 @@
'wonWhenSeenStreet2': 0.0, 'wonWhenSeenStreet2': 0.0,
'wonWhenSeenStreet3': 0.0, 'wonWhenSeenStreet3': 0.0,
'wonWhenSeenStreet4': 0.0}, 'wonWhenSeenStreet4': 0.0},
u'Player4': { 'card1': 0, u'Player4': { 'card1': 16,
'card2': 0, 'card2': 34,
'card3': 0, 'card3': 0,
'card4': 0, 'card4': 0,
'card5': 0, 'card5': 0,

View File

@ -0,0 +1,54 @@
Game #9581478205 starts.
#Game No : 9581478205
***** Hand History for Game 9581478205 *****
$0.50/$1 USD 7 Card Stud Hi-Lo - Monday, August 30, 20:20:17 EEST 2010
Table Table 136403 (Real Money)
Seat 0 is the button
Total number of players : 7/8
Seat 3: XMAN1 ( $24.95 USD )
Seat 5: ISqzUSqueal ( $31.02 USD )
Seat 7: PPPPPositive ( $4.20 USD )
Seat 8: Unladylike ( $19 USD )
Seat 6: YMAN1 ( $10.18 USD )
Seat 2: strandalleen ( $17.55 USD )
Seat 1: tubby09 ( $24.20 USD )
tubby09 posts ante [$0.05 USD]
strandalleen posts ante [$0.05 USD]
XMAN1 posts ante [$0.05 USD]
ISqzUSqueal posts ante [$0.05 USD]
YMAN1 posts ante [$0.05 USD]
PPPPPositive posts ante [$0.05 USD]
Unladylike posts ante [$0.05 USD]
** Dealing **
Dealt to XMAN1 [ Td 5s 3c ]
YMAN1 opens
YMAN1 bring-ins [$0.25 USD]
PPPPPositive completes [$0.50 USD]
Unladylike folds
tubby09 folds
strandalleen calls [$0.50 USD]
XMAN1 folds
ISqzUSqueal folds
YMAN1 calls [$0.25 USD]
** Dealing Fourth street **
PPPPPositive opens
PPPPPositive bets [$0.50 USD]
strandalleen calls [$0.50 USD]
YMAN1 folds
** Dealing Fifth street **
PPPPPositive opens
PPPPPositive bets [$1 USD]
strandalleen calls [$1 USD]
** Dealing Sixth street **
PPPPPositive opens
PPPPPositive bets [$1 USD]
strandalleen calls [$1 USD]
** Dealing River **
PPPPPositive opens
PPPPPositive bets [$1 USD]
strandalleen calls [$1 USD]
PPPPPositive shows [ Ad, Qd, Ah, 2d, 7d, Th, 6d ]a flush, Ace high.
strandalleen doesn't show [ 5h, 9d, 9c, Qc, 2h, Kc, Js ]a pair of Nines.
PPPPPositive wins $8.45 USD from the main pot with a flush, Ace high.
There was no qualifying low hand

View File

@ -0,0 +1,225 @@
PokerStars Game #49164202872: Badugi Limit ($0.25/$0.50 USD) - 2010/09/05 10:32:15 ET
Table 'Benkoela V' 8-max Seat #8 is the button
Seat 1: Lino19 ($6.80 in chips)
Seat 2: s0rrow ($5 in chips)
Seat 3: jodarin ($0.70 in chips)
Seat 4: Scorpio2000 ($3.40 in chips)
Seat 5: buddyboy3399 ($8.25 in chips)
Seat 6: JDANIELDC ($8.75 in chips)
Seat 8: Kula91 ($3.80 in chips)
Lino19: posts small blind $0.10
s0rrow: posts big blind $0.25
cuchiku: sits out
*** DEALING HANDS ***
Dealt to s0rrow [As 3h 8h 6s]
jodarin: calls $0.25
Scorpio2000: calls $0.25
buddyboy3399: calls $0.25
JDANIELDC: folds
Kula91: folds
Kula91 leaves the table
Lino19: calls $0.15
s0rrow: checks
*** FIRST DRAW ***
Lino19: discards 1 card
s0rrow: discards 2 cards [8h 6s]
Dealt to s0rrow [As 3h] [5h Ks]
jodarin: discards 2 cards
Scorpio2000: discards 1 card
buddyboy3399: discards 2 cards
Lino19: bets $0.25
s0rrow: folds
jodarin: calls $0.25
Scorpio2000: calls $0.25
buddyboy3399: raises $0.25 to $0.50
Lino19: calls $0.25
jodarin: calls $0.20 and is all-in
Scorpio2000: calls $0.25
*** SECOND DRAW ***
Lino19: discards 1 card
jodarin: discards 2 cards
Scorpio2000: discards 1 card
buddyboy3399: stands pat
Lino19: checks
Scorpio2000: bets $0.50
buddyboy3399: calls $0.50
Lino19: calls $0.50
*** THIRD DRAW ***
Lino19: discards 1 card
jodarin: discards 2 cards
Scorpio2000: stands pat
buddyboy3399: stands pat
Lino19: checks
Scorpio2000: bets $0.50
buddyboy3399: calls $0.50
Lino19: folds
*** SHOW DOWN ***
Scorpio2000: shows [8c 5d 7s Th] (Badugi: T,8,7,5)
buddyboy3399: shows [8s 3d Ac 4h] (Badugi: 8,4,3,A)
buddyboy3399 collected $2.55 from side pot
jodarin: mucks hand
buddyboy3399 collected $2.90 from main pot
jodarin leaves the table
*** SUMMARY ***
Total pot $5.70 Main pot $2.90. Side pot $2.55. | Rake $0.25
Seat 1: Lino19 (small blind) folded after the 3rd Draw
Seat 2: s0rrow (big blind) folded after the 1st Draw
Seat 3: jodarin mucked [Ad Td Qc 2s]
Seat 4: Scorpio2000 showed [8c 5d 7s Th] and lost with a Badugi: T,8,7,5
Seat 5: buddyboy3399 showed [8s 3d Ac 4h] and won ($5.45) with a Badugi: 8,4,3,A
Seat 6: JDANIELDC folded before the Draw (didn't bet)
Seat 8: Kula91 (button) folded before the Draw (didn't bet)
PokerStars Game #49164247462: Badugi Limit ($0.25/$0.50 USD) - 2010/09/05 10:33:25 ET
Table 'Benkoela V' 8-max Seat #1 is the button
Seat 1: Lino19 ($5.55 in chips)
Seat 2: s0rrow ($4.75 in chips)
Seat 4: Scorpio2000 ($1.65 in chips)
Seat 5: buddyboy3399 ($11.95 in chips)
Seat 6: JDANIELDC ($8.75 in chips)
s0rrow: posts small blind $0.10
Scorpio2000: posts big blind $0.25
cuchiku: sits out
*** DEALING HANDS ***
Dealt to s0rrow [3h Tc Kc Ad]
oooDestroyoo joins the table at seat #3
kallexx1 joins the table at seat #8
buddyboy3399: folds
JDANIELDC: folds
Lino19: folds
s0rrow: folds
Uncalled bet ($0.15) returned to Scorpio2000
Scorpio2000 collected $0.20 from pot
Scorpio2000: doesn't show hand
*** SUMMARY ***
Total pot $0.20 | Rake $0
Seat 1: Lino19 (button) folded before the Draw (didn't bet)
Seat 2: s0rrow (small blind) folded before the Draw
Seat 4: Scorpio2000 (big blind) collected ($0.20)
Seat 5: buddyboy3399 folded before the Draw (didn't bet)
Seat 6: JDANIELDC folded before the Draw (didn't bet)
PokerStars Game #49164255772: Badugi Limit ($0.25/$0.50 USD) - 2010/09/05 10:33:38 ET
Table 'Benkoela V' 8-max Seat #2 is the button
Seat 1: Lino19 ($5.55 in chips)
Seat 2: s0rrow ($4.65 in chips)
Seat 4: Scorpio2000 ($1.75 in chips)
Seat 5: buddyboy3399 ($11.95 in chips)
Seat 6: JDANIELDC ($8.75 in chips)
Seat 8: kallexx1 ($5000 in chips)
oooDestroyoo will be allowed to play after the button
Scorpio2000: posts small blind $0.10
buddyboy3399: posts big blind $0.25
cuchiku: sits out
kallexx1: posts big blind $0.25
*** DEALING HANDS ***
Dealt to s0rrow [4s 8s Kc 3h]
JDANIELDC: calls $0.25
kallexx1: checks
Lino19: folds
s0rrow: folds
Scorpio2000: calls $0.15
cuchiku leaves the table
buddyboy3399: raises $0.25 to $0.50
JDANIELDC: calls $0.25
kallexx1: calls $0.25
Scorpio2000: folds
*** FIRST DRAW ***
buddyboy3399: stands pat
JDANIELDC: discards 2 cards
kallexx1: stands pat
buddyboy3399: bets $0.25
JDANIELDC: folds
kallexx1: calls $0.25
*** SECOND DRAW ***
buddyboy3399: stands pat
kallexx1: discards 1 card
buddyboy3399: bets $0.50
kallexx1: calls $0.50
*** THIRD DRAW ***
buddyboy3399: stands pat
kallexx1: discards 1 card
buddyboy3399: bets $0.50
kallexx1: calls $0.50
*** SHOW DOWN ***
buddyboy3399: shows [Tc 3s 2s 7h] (3-card: T,7,2)
kallexx1: shows [4c 4d 5s 6h] (3-card: 6,5,4)
kallexx1 collected $4.05 from pot
*** SUMMARY ***
Total pot $4.25 | Rake $0.20
Seat 1: Lino19 folded before the Draw (didn't bet)
Seat 2: s0rrow (button) folded before the Draw (didn't bet)
Seat 4: Scorpio2000 (small blind) folded before the Draw
Seat 5: buddyboy3399 (big blind) showed [Tc 3s 2s 7h] and lost with a 3-card: T,7,2
Seat 6: JDANIELDC folded after the 1st Draw
Seat 8: kallexx1 showed [4c 4d 5s 6h] and won ($4.05) with a 3-card: 6,5,4
PokerStars Game #49164287914: Badugi Limit ($0.25/$0.50 USD) - 2010/09/05 10:34:29 ET
Table 'Benkoela V' 8-max Seat #4 is the button
Seat 1: Lino19 ($5.55 in chips)
Seat 2: s0rrow ($4.65 in chips)
Seat 3: oooDestroyoo ($20 in chips)
Seat 4: Scorpio2000 ($1.50 in chips)
Seat 5: buddyboy3399 ($10.20 in chips)
Seat 6: JDANIELDC ($8.25 in chips)
Seat 8: kallexx1 ($5002.30 in chips)
buddyboy3399: posts small blind $0.10
JDANIELDC: posts big blind $0.25
oooDestroyoo: posts big blind $0.25
*** DEALING HANDS ***
Dealt to s0rrow [2h 5c Kd 7h]
kallexx1: folds
kallexx1 leaves the table
Lino19: folds
s0rrow: folds
oooDestroyoo: checks
Scorpio2000: calls $0.25
buddyboy3399: calls $0.15
JDANIELDC: checks
*** FIRST DRAW ***
buddyboy3399: discards 1 card
JDANIELDC: discards 2 cards
oooDestroyoo: discards 2 cards
Scorpio2000: discards 2 cards
buddyboy3399: bets $0.25
JDANIELDC: calls $0.25
oooDestroyoo: calls $0.25
Scorpio2000: folds
*** SECOND DRAW ***
buddyboy3399: stands pat
JDANIELDC: discards 1 card
oooDestroyoo: discards 1 card
buddyboy3399: bets $0.50
JDANIELDC: calls $0.50
oooDestroyoo: calls $0.50
*** THIRD DRAW ***
buddyboy3399: stands pat
JDANIELDC: discards 1 card
oooDestroyoo: discards 1 card
buddyboy3399: bets $0.50
JDANIELDC: raises $0.50 to $1
oooDestroyoo: calls $1
buddyboy3399: calls $0.50
*** SHOW DOWN ***
JDANIELDC: shows [3c 4d 6h 8s] (Badugi: 8,6,4,3)
oooDestroyoo: mucks hand
buddyboy3399: mucks hand
JDANIELDC collected $5.95 from pot
*** SUMMARY ***
Total pot $6.25 | Rake $0.30
Seat 1: Lino19 folded before the Draw (didn't bet)
Seat 2: s0rrow folded before the Draw (didn't bet)
Seat 3: oooDestroyoo mucked [9d 3d 2s 7c]
Seat 4: Scorpio2000 (button) folded after the 1st Draw
Seat 5: buddyboy3399 (small blind) mucked [Qh 3s 4c Td]
Seat 6: JDANIELDC (big blind) showed [3c 4d 6h 8s] and won ($5.95) with a Badugi: 8,6,4,3
Seat 8: kallexx1 folded before the Draw (didn't bet)