From bd12fc641097671416d8f3853620e14019d1190d Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Sun, 9 Aug 2009 20:22:23 +0100 Subject: [PATCH] fixes.. --- pyfpdb/PartyPokerToFpdb.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) mode change 100644 => 100755 pyfpdb/PartyPokerToFpdb.py diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py old mode 100644 new mode 100755 index b4c02f03..2b1619db --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -43,6 +43,7 @@ class PartyPoker(HandHistoryConverter): ############################################################ # Class Variables + sitename = "PartyPoker" codepage = "cp1252" siteId = 9 # TODO: automate; it's a class variable so shouldn't hit DB too often filetype = "text" # "text" or "xml". I propose we subclass HHC to HHC_Text and HHC_XML. @@ -114,9 +115,9 @@ class PartyPoker(HandHistoryConverter): 'CUR': hand.gametype['currency'] if hand.gametype['currency']!='T$' else ''} for key in ('CUR_SYM', 'CUR'): subst[key] = re.escape(subst[key]) - logging.debug("player_re: " + subst['PLYR']) - logging.debug("CUR_SYM: " + subst['CUR_SYM']) - logging.debug("CUR: " + subst['CUR']) + log.debug("player_re: " + subst['PLYR']) + log.debug("CUR_SYM: " + subst['CUR_SYM']) + log.debug("CUR: " + subst['CUR']) self.re_PostSB = re.compile( r"^%(PLYR)s posts small blind \[%(CUR_SYM)s(?P[.0-9]+) ?%(CUR)s\]\." % subst, re.MULTILINE) @@ -172,7 +173,7 @@ class PartyPoker(HandHistoryConverter): gametype dict is: {'limitType': xxx, 'base': xxx, 'category': xxx}""" - logging.debug(self.ParsingException().wrapHh( handText )) + log.debug(self.ParsingException().wrapHh( handText )) info = {} m = self._getGameType(handText) @@ -244,7 +245,7 @@ class PartyPoker(HandHistoryConverter): #hand.maxseats = ??? hand.mixed = None - logging.debug("readHandInfo: %s" % info) + log.debug("readHandInfo: %s" % info) for key in info: if key == 'DATETIME': #Saturday, July 25, 07:53:52 EDT 2009 @@ -284,10 +285,10 @@ class PartyPoker(HandHistoryConverter): if m: hand.buttonpos = int(m.group('BUTTON')) else: - logging.info('readButton: not found') + log.info('readButton: not found') def readPlayerStacks(self, hand): - logging.debug("readPlayerStacks") + log.debug("readPlayerStacks") m = self.re_PlayerInfo.finditer(hand.handText) players = [] for a in m: @@ -314,7 +315,7 @@ class PartyPoker(HandHistoryConverter): hand.setCommunityCards(street, renderCards(m.group('CARDS'))) def readAntes(self, hand): - logging.debug("reading antes") + log.debug("reading antes") m = self.re_Antes.finditer(hand.handText) for player in m: hand.addAnte(player.group('PNAME'), player.group('ANTE')) @@ -445,7 +446,4 @@ if __name__ == "__main__": (options, args) = parser.parse_args() - #LOG_FILENAME = './logging.out' - logging.basicConfig(level=options.verbosity) - e = PartyPoker(in_path = options.ipath, out_path = options.opath, follow = options.follow)