_mysql_exceptions.IntegrityError: (1062, "Duplicate entry 'romatrifon (small blind) showed -1' for key 'name'")
Previous regex was matching past the name.
From: lucktard <ntogden@gmail.com>
Date: Wed, 30 Sep 2009 12:16:06 -0500
Subject: [PATCH] Detect and import capped 6 max hands on FullTilt
and
From b35d23aba38935406cf1522ae07a49cd441318b3 Mon Sep 17 00:00:00 2001
From: lucktard <ntogden@gmail.com>
Date: Wed, 30 Sep 2009 12:21:34 -0500
Subject: [PATCH] Detect deep 6 max tables for HUD on FT
modified: FulltiltToFpdb.py
* Tourney Summary File parsing : add support for Madness tourneys
* HH file parsing : enhance Tourney topline parsing to retrieve some info (HU, Rebuy, KO, Turbo, ...) and store it into Hand object
modified: Hand.py
* Some attributes added to store tourney specific info
modified: SQL.py
* Add a new request (getTourneyTypeIdByTourneyNo) to help finding a tourney already in db (preparation for Tourney Summary import)
modified: Tourney.py
* Attribute tourneyComment added
modified: fpdb_parse_logic.py
* Change parameters in call of fpdb_simple.recogniseTourneyTypeId
modified: fpdb_simple.py
* recogniseTourneyTypeId : signature changed to allow for the search of a tourney id already in db prior to searching for tourneyTypeId
modified: FulltiltToFpdb.py
* Modified re_HandInfo regex to take into account Matrix Tournament Hands Histories
* Add Regex for Tourney Summaries files parsing
* New methods : readSummaryInfo, determineTourneyType, getPlayersPositionsAndWinnings
modified: HandHistoryConverter.py
* Add a Tourney object in the attributes to allow storing the summary info retrieved and the ability to hand it over after parsing
* Add a new attribut parsedObjectType (string : "HH" or "Summary")
* In follow = False mode : read the first line to swicth between HH & Summary parsing
* TO DO : Deal with parsing summary files in follow = True mode
* New methods added : isSummary, getParsedObjectType (to be called in fpdb_import), readSummaryInfo : abstract (to be implemented in each specific HHC), getTourney (returns the new attribute)
new file: Tourney.py
* New object
* Lots of attributes regarding the tourney info (buy-in, fee, entries, speed, Rebuy/add-on info, starting chips, KnockOut info, isHeadsUp, isShootout, isMatrix, ...
* List of players with finishing positions (when available) and winnings (when available)
* Methods :
** addPlayer(self, rank, name, winnings)
** incrementPlayerWinnings(self, name, additionnalWinnings): used for KO tourneys when KO occured (for Hero only)
** calculatePayinAmount : unused yet, should be necessary for DB storage
** some Hand methods copied that are still to be done including : assemble and insert
** TO DO : write the insert method for the object to be stored in DB. This will have to deal with the fact that the DB write can occur both before (Bulk Import) or after the HH file info has been stored (tourney might or might not already exist)
modified: fpdb_import.py
* import_file_dict modified :
** after the construction of the hhc, it now calls the new getParsedObjectType method of HHC in order to know what has been parsed by the HHC
** If it's a hand history file (actual expected behaviour) : do as before
** If it's a summary file, gets the tourney object that has been built from the hhc and calls the insert method on it (similar to NEWIMPORT=True for HH)
modified: FulltiltToFpdb.py
- Sitting out players are no longer considered out of a hand (in a tourney context, they can act even if out at the beggining of the hand)
- re_CollectPot modified to take into account Tournament context (no $ in the pot)
- Try to read buy-in/fee from topline in Tournament context
- Deal with commas in pot size (readCollectPot)
Better exception handling during parsing
FpdbParseEcxeption takes an optional HID
Stripped pointless __init__s from *ToFpdb subclasses
Logging now has logging.conf config - default is to log only INFO to
file but easily changed to DEBUG for devel work
EverleafToFpdb: remove DEBUG XXXXXXX line
FulltiltToFpdb: pass on converting tournament hands
Hand: add Hand.fee var that Database is looking for
fpdb_import: clean up file update scan code, queue files that have changed in the last 60 seconds for the next importer pass, instead of locking it up reading them now (not that this does anything since FT no longer updates the mtime until it closes the table, but maybe it works with Stars or others)
Make tail work:
-log instead of print inode # change detected,
-make sure splitter regexes have groups around them
-fix a bug
-increase buffering size to something >> a single hand
Conflicts:
pyfpdb/HandHistoryConverter.py
Adds 1 restriction to the HHC sub classes, the classname must be the
same as the filename - ToFpdb.py
FulltiltToFpdb.py must contain a hhc class named Fulltilt
EverleafToFpdb.py must contain a hhc class named Everleaf
Let me know how you get on.
I just remembered autoimport probably broken at this point, I have
changed the way HHC is called and only been testing standalone
filtering..
Just try it and then git checkout ^HEAD
Merge branch 'monkeyfutz'
Conflicts:
pyfpdb/EverleafToFpdb.py
pyfpdb/FulltiltToFpdb.py
pyfpdb/Hand.py
- made it so that Hand.__init__ calls the hhc readX methods in the right
order for that kind of Hand (Stud or Holdem/Omaha)
- hhc.readX methods then callback Hand.addX methods
Why? WHY! I hear you ask. Actually I can see there's very little gain,
sorry about that; but it sort of makes sense. Now you just make the
right kind of Hand, give it the text and the right kind of HHC filter,
and it makes itself.
- apart from that, biggest actual thing done is probably in adding
player cards for stud hands -- revamped and made it really clear (I
think) whats happening (see FullTilt.readStudPlayerCards)
When I run FullTiltToFpdf.py it goes through all the hands.
- Still have some print statements, have been changing them to
logging.debug or logging.info as I come across them.
You may find "tail -f logging.out" useful
Actually I'm not at all convinced about the use of logging except that
you can redirect it to stderr quite easily and then set the threshold
for what gets logged quite easily, so that might be a plus.
- Oh and the subclassing of Hand is getting clearer.