#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2008-2011, Carl Gherardi # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ######################################################################## import L10n _ = L10n.get_translation() import sys import exceptions import logging # logging has been set up in fpdb.py or HUD_main.py, use their settings: import Configuration from HandHistoryConverter import * from decimal_wrapper import Decimal import time # Winamax HH Format class Winamax(HandHistoryConverter): def Trace(f): def my_f(*args, **kwds): print ( "entering " + f.__name__) result= f(*args, **kwds) print ( "exiting " + f.__name__) return result my_f.__name = f.__name__ my_f.__doc__ = f.__doc__ return my_f filter = "Winamax" siteName = "Winamax" filetype = "text" codepage = ("utf8", "cp1252") siteId = 14 # Needs to match id entry in Sites database mixes = { } # Legal mixed games sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": u"\xe2\x82\xac|\u20ac", "GBP": "\xa3"} # ADD Euro, Sterling, etc HERE substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes 'LS' : u"\$|\xe2\x82\xac|\u20ac|" # legal currency symbols - Euro(cp1252, utf-8) } limits = { 'no limit':'nl', 'pot limit' : 'pl','LIMIT':'fl'} games = { # base, category "Holdem" : ('hold','holdem'), 'Omaha' : ('hold','omahahi'), # 'Omaha Hi/Lo' : ('hold','omahahilo'), # 'Razz' : ('stud','razz'), # 'RAZZ' : ('stud','razz'), # '7 Card Stud' : ('stud','studhi'), # 'SEVEN_CARD_STUD_HI_LO' : ('stud','studhilo'), # 'Badugi' : ('draw','badugi'), # 'Triple Draw 2-7 Lowball' : ('draw','27_3draw'), # '5 Card Draw' : ('draw','fivedraw') } # Static regexes # ***** End of hand R5-75443872-57 ***** re_SplitHands = re.compile(r'\n\n') # Winamax Poker - CashGame - HandId: #279823-223-1285031451 - Holdem no limit (0.02€/0.05€) - 2010/09/21 03:10:51 UTC # Table: 'Charenton-le-Pont' 9-max (real money) Seat #5 is the button re_HandInfo = re.compile(u""" \s*Winamax\sPoker\s-\s (?PCashGame)? (?PTournament\s (?P.+)?\s buyIn:\s(?P(?P[%(LS)s\d\,]+)?\s\+?\s(?P[%(LS)s\d\,]+)?\+?(?P[%(LS)s\d\.]+)?\s?(?P%(LEGAL_ISO)s)?|Freeroll|Gratuit|Ticket\suniquement)?\s (level:\s(?P\d+))? .*)? \s-\sHandId:\s\#(?P\d+)-(?P\d+)-(?P\d+).*\s # REB says: HID3 is the correct hand number (?PHoldem|Omaha)\s (?Pno\slimit|pot\slimit)\s \( (((%(LS)s)?(?P[.0-9]+)(%(LS)s)?)/)? ((%(LS)s)?(?P[.0-9]+)(%(LS)s)?)/ ((%(LS)s)?(?P[.0-9]+)(%(LS)s)?) \)\s-\s (?P.*) Table:\s\'(?P[^(]+) (.(?P\d+).\#(?P\d+))?.* \' \s(?P\d+)\-max """ % substitutions, re.MULTILINE|re.DOTALL|re.VERBOSE) re_TailSplitHands = re.compile(r'\n\s*\n') re_Button = re.compile(r'Seat\s#(?P