#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2010, 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 ######################################################################## #Note that this filter also supports UltimateBet, they are both owned by the same company and form the Cereus Network import L10n _ = L10n.get_translation() # TODO: I have no idea if AP has multi-currency options, i just copied the regex out of Everleaf converter for the currency symbols.. weeeeee - Eric import sys import logging from HandHistoryConverter import * # Class for converting Absolute HH format. class Absolute(HandHistoryConverter): # Class Variables sitename = "Absolute" filetype = "text" codepage = "cp1252" siteid = 8 HORSEHand = False # Static regexes re_SplitHands = re.compile(r"\n\n+") re_TailSplitHands = re.compile(r"(\nn\n+)") #Stage #1571362962: Holdem No Limit $0.02 - 2009-08-05 15:24:06 (ET) #Table: TORONTO AVE (Real Money) Seat #6 is the dealer #Seat 6 - FETS63 ($0.75 in chips) #Board [10s 5d Kh Qh 8c] re_GameInfo = re.compile( ur""" ^Stage\s+\#C?(?P[0-9]+):?\s+ (?:Tourney\ ID\ (?P\d+)\s+)? (?PHoldem|Seven\ Card\ Hi\/L|HORSE)\s+ (?P\(1\son\s1\)|Single\ Tournament|Multi\ Normal\ Tournament|)\s* (?PNo\ Limit|Pot\ Limit|Normal|)\s? (?P\$|\s€|) (?P[.,0-9]+)/?(?:\$|\s€|)(?P[.,0-9]+)? \s+-\s+ (?P\d\d\d\d-\d\d-\d\d\ \d\d:\d\d:\d\d)\s+ (?: \( (?P[A-Z]+) \)\s+ )? .*? (Table:\ (?P.*?)\ \(Real\ Money\))? """, re.MULTILINE|re.VERBOSE|re.DOTALL) re_HorseGameInfo = re.compile( ur"^Game Type: (?PLimit) (?PHoldem)", re.MULTILINE) re_HandInfo = re_GameInfo # on HORSE STUD games, the table name isn't in the hand info! re_RingInfoFromFilename = re.compile(ur".*IHH([0-9]+) (?P
.*) -") re_TrnyInfoFromFilename = re.compile( ur"IHH\s?([0-9]+) (?P.*) "\ ur"ID (?P\d+)\s?(\((?P
\d+)\))? .* "\ ur"(?:\$|\s€|)(?P[0-9.]+)\s*\+\s*(?:\$|\s€|)(?P[0-9.]+)" ) # TODO: that's not the right way to match for "dead" dealer is it? re_Button = re.compile(ur"Seat #(?P