From 0986e36648c9248c00c6a7e1c9e7c183bc032e9d Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Thu, 26 Feb 2009 00:59:36 +0000 Subject: [PATCH] work in progress! - command line options Try the following ./Everleaf --help cat everleaf.txt | ./Everleaf -i - -o - Try using -i -, and pasting in a hand. Be aware it needs an EOF -d (unless you specify --follow, which isn't done yet) - HHC is a thread - hand gametypes per hand - lots of stupid little things just to cause trouble - added logging Not yet done: - tail -f mode - integration into fpdb_import. Two options for grand plan here: 1) recently modified files get a HHC filter attached when the HHC runs out of pipe it waits runUpdated finds modified files and notifies the thread 2) the thread follows independently, when it runs out of input it sleeps and then tries again at intervals I like both, 1) involves bigger changes to fpdb_import whilst with 2) we just point the existing fpdb_import code at the filter output (the way we currently do filtering has to be altered though) Comments welcome of course. --- pyfpdb/EverleafToFpdb.py | 93 +++++++++++++---------- pyfpdb/GuiBulkImport.py | 2 +- pyfpdb/Hand.py | 14 ++-- pyfpdb/HandHistoryConverter.py | 135 +++++++++++++++++++++++++++------ 4 files changed, 171 insertions(+), 73 deletions(-) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index f04480bf..b7bb1d8a 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -18,9 +18,8 @@ ######################################################################## import sys -import Configuration from HandHistoryConverter import * -from time import strftime + # Class for converting Everleaf HH format. @@ -29,27 +28,27 @@ class Everleaf(HandHistoryConverter): # Static regexes re_SplitHands = re.compile(r"\n\n+") re_GameInfo = re.compile(r".*Blinds \$?(?P[.0-9]+)/\$?(?P[.0-9]+) (?P(NL|PL)) (?P(Hold\'em|Omaha|7 Card Stud))") - re_HandInfo = re.compile(r".*#(?P[0-9]+)\n.*\nBlinds \$?(?P[.0-9]+)/\$?(?P[.0-9]+) (?P.*) - (?P\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P[- a-zA-Z]+)") + re_HandInfo = re.compile(r".*#(?P[0-9]+)\n.*\nBlinds \$?(?P[.0-9]+)/\$?(?P[.0-9]+) (?P.*) - (?P\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P
[- a-zA-Z]+)", re.MULTILINE) re_Button = re.compile(r"^Seat (?P