diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py new file mode 100644 index 00000000..3fc42665 --- /dev/null +++ b/pyfpdb/AbsoluteToFpdb.py @@ -0,0 +1,335 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2008, 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 +######################################################################## + +# 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): + + # Static regexes + re_SplitHands = re.compile(r"\n\n\n+") + re_TailSplitHands = re.compile(r"(\n\n\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 #([0-9]+): (?PHoldem|) (?PNo Limit|) (?P\$| €|)(?P[0-9]*[.0-9]+)", re.MULTILINE) + re_HandInfo = re.compile(ur"^Stage #(?P[0-9]+): .*(?P\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d).*\nTable: (?P.*) \(Real Money\)", re.MULTILINE) + re_Button = re.compile(ur"Seat #(?P
.+$)", re.MULTILINE) +# re_Button = re.compile(ur"^Seat (?P
\d+)\)?\s+ + (?:[^ ]+\s+\#(?P\d+).+)? # table number for mtt + \((?PReal|Play)\s+Money\)\s+ # FIXME: check if play money is correct + Seat\s+(?P
[-\ a-zA-Z\d]+)\'\s + #((?P\d+)-max\s)? + #(?P\(Play\sMoney\)\s)? + #(Seat\s\#(?P
[ a-zA-Z]+) - \$?(?P[.0-9]+)/\$?(?P[.0-9]+) - (?P.*) - (?P
[0-9]+):(?P[0-9]+) ET - (?P[0-9]+)/(?P[0-9]+)/(?P[0-9]+)Table (?P
[ a-zA-Z]+)\nSeat (?P