Commit Graph

306 Commits

Author SHA1 Message Date
Worros
7b319d5aa0 Hand.py: Add in test data to prepInsert 2011-03-29 14:58:44 +08:00
Chaz Littlejohn
a87f43f933 Updated the import process for Draw hands so that cards, along with additional draws can now be stored. HandsPlayers now includes 20 card fields to accomodate up to 4 five card hands for each player. The regex for the 'stands pat' action was also improved so that hero cards from those streets could be taken from that line of text 2011-03-24 06:00:10 +00:00
Chaz Littlejohn
8c4d5d42b4 Added printtest back in and fixed a couple of SessionsCache bugs 2011-03-23 19:27:55 +00:00
Chaz Littlejohn
66e1cc3704 This commit includes a set of updates which:
* implement the new SessionsCache table
    - The SessionsCache table can be used to track overall or game sepecific sessions
    - The totalProfit field is summed by gameTypeId for cash games allowing for multiple currencies
    - Tournament profit (cashes - buy-ins) are also recorded in totalProfit and its grouped by tourneyId
* change the sequence and methodology surrounding the import of hands
    - fpdb_import.py implements a unique Hand.py method for each table
    - Hands SessionCache and HudCache records themselves are 'cached' to allow for 'bulk insert' at EOF
    - import is reorganized to allow for efficient locking in multiple connection environments
* changes the name of the index created by addTPlayersIndex (so that it is unique) to accommodate a bug in MySQL 5.5

TODO
* A 'rebuild_sessionsCache' method is still required
* Further commits are expected to fix bugs created during the porting of this code
2011-03-23 19:27:55 +00:00
Worros
66112a8d6e Hand.py: Add CAD currency
Patch from Mathieu Pagé <mathieu@mathieupage.com>
2011-03-21 11:15:19 +08:00
Steffen Schaumburg
8a519699b5 update copyright year 2011-03-10 06:16:31 +01:00
Steffen Schaumburg
792b110ee1 more string unification 2011-03-10 05:14:16 +01:00
Steffen Schaumburg
5a0f2946a4 fix many strings that weren't being picked up by gettext's parser 2011-03-10 04:15:53 +01:00
Worros
302af8eae9 Hand.select(): Minor update
- Fix query after schema change.
- Convert code attempting to use row_factory to a slower equivalent
2011-03-01 16:13:58 +08:00
Worros
3d7f75c933 Merge branch 'master' of git://git.assembla.com/fpdb 2011-02-28 10:00:45 +08:00
Steffen Schaumburg
828dce7ebe fix to make it work without save actions again, by chaz 2011-02-28 02:01:06 +01:00
atinm
644b2d7849 replaced /usr/bin/python with /usr/bin/env python 2011-02-27 21:17:07 +08:00
Steffen Schaumburg
99a0e04e3e Merge branch 'master' of git://github.com/swolchok/fpdb into scott
Conflicts:
	pyfpdb/Database.py
	pyfpdb/decimal_wrapper.py
2011-02-26 01:09:40 +01:00
Scott Wolchok
fc46b70c41 Rename decimal.py to decimal_wrapper.py so we don't break when
cdecimal is not installed.
2011-02-25 14:18:12 -05:00
Worros
7be88ef080 Hand: Sanitise number from Stud bring-in 2011-02-25 18:07:14 +08:00
Worros
f006b7c253 Hand.py: Use sum(x) instead of reduce(operator.add, x, 0)
From: Scott Wolchok <scott@wolchok.org>

Make the code slightly more readable
2011-02-25 13:05:39 +08:00
Worros
0f54f3d80c Hand.py: Call Decimal ctor a lot less.
From: Scott Wolchok <scott@wolchok.org>
2011-02-24 22:51:40 +08:00
Worros
cf937285ea Hand.py: Use str.replace instead of re.sub for stripping commas.
From: Scott Wolchok <scott@wolchok.org>
2011-02-24 22:49:50 +08:00
Scott Wolchok
cdf158cfae Hand.py: Call Decimal ctor a lot less. 2011-02-23 23:41:14 -05:00
Scott Wolchok
1227c5df74 Hand.py: Use sum(x) instead of reduce(operator.add, x, 0). 2011-02-23 23:31:46 -05:00
Scott Wolchok
00f98f0e12 Hand.py: Use str.replace instead of re.sub for stripping commas. 2011-02-23 23:28:37 -05:00
Worros
e4a3de1272 Merge branch 'chaz' of git://github.com/ChazDazzle/fpdb-chaz 2011-02-17 11:28:44 +08:00
Steffen Schaumburg
2e27c46b76 minor string changes 2011-02-14 16:12:07 +01:00
Worros
391dea0b7e Hand: Adjust log message to include hid 2011-02-07 23:17:26 +08:00
Worros
341f5198b8 Hand: Throw error when Draw hand has no deal section
Resolves: https://sourceforge.net/apps/mantisbt/fpdb/view.php?id=76
2011-01-25 13:10:50 +08:00
Worros
5ec9c41efb Hand: Refactor addBlind function
addBlind was separate for draw and flop games.

There should only be 2 lines difference between the functions, so merged them with appropriate changes.
2011-01-14 14:36:23 +08:00
Worros
2188bb7865 Hand.py: Add gametyperow variable
To be used for regression testing by THP
2011-01-13 14:28:51 +08:00
Worros
f12bc7bfaa Add printdata capability for Gametype info. 2011-01-07 13:58:15 +08:00
chaz@pokeit.co
38e6e15a26 Modified import_file_dict() so that it stores HandsPlayers and HandsActions inserts in a temprorary list. Once the end of the handlist is reached, an executemany() bulk insert is done. 2011-01-01 15:40:06 -05:00
chaz@pokeit.co
990e226254 storeSessionsCache() now adds a sessionId to the Hands table 2011-01-01 03:35:14 -05:00
chaz@pokeit.co
838c626bba Changed the HandsActions table join index from 'handsPlayersId' to 'handId' and 'playerId'. This allows us to use executemany(), which is faster, in storeHandsPlayers when storing actions. 2010-12-31 15:30:29 -05:00
Worros
6487691b69 Hand: Add pot calculations to select() 2010-12-22 13:26:41 +08:00
Worros
2382152cb8 Hand: select() update - Fix holecards for holdem 2010-12-22 13:20:43 +08:00
Worros
d94f7a68a2 Hand: Fix for stack print in writeHand 2010-12-22 13:08:41 +08:00
Worros
9cff165c3c Hand: select() updates
Fix SQL for seat order

Fix startTime formating

Add lots of commented out debug
2010-12-22 13:04:20 +08:00
Worros
10fc52e96f Hand: First pass at select() for Hand 2010-12-22 12:13:58 +08:00
Worros
70c3480105 Hand: Start select() method
Can currently add the players in the hand. Still a long way to go, but a good start
2010-12-17 19:03:50 +08:00
Worros
caa2104fa9 Fix for FTP Razz crasher
When a player is listed as playing the hand and sits out between the listing and ante-up join_holecards returned only 2 cards causing Card.encodeRazzStartHand() to crash.

Make sure that join_holecards must return at least 3 cards for stud, and add an entry for this case in the lookup table
2010-12-11 01:26:56 +08:00
Worros
7dd8b9de16 Rename gameTypeId to gametypeId
Go through and change all references to gameTypeId to gametypeId to make it consistent.

The database field is named with the lowercase version, and MySQL is case sensitive.

This may have been causing minor issues in multiple areas when attempting to join on gametype.
2010-12-10 22:31:12 +08:00
Worros
02204edc48 Give storeHands the ability to output test data
Will allow for regression testing of hand start time
2010-12-10 21:35:49 +08:00
Chaz
0c46965d98 Finished up code for creating and updating SessionsCache. Table includes fields for sessionStart, sessionEnd, ring hands, tournament hands, ring totalProfit, and ring bigBets won during each session. bigBets field is a python float stored as a REAL in the database (I am open to alternative suggestions). Also, storeSessions is currently set to False. 2010-12-04 17:40:48 -05:00
Chaz
925db93157 * Added 'cacheSessions' flag
* Added a cacheSessions update call to import_file_dict() in fpdb_import.py
* Added updateSessionsCache() method to Hands
* Added storeSessionsCache() to Database --- WORK IN PROGRESS and set to pass
TO DOs
- add sessions queries to SQL
- complete storeSessionsCache() so it works like we've discussed (save for adding sessionId to HP)
- add SessionsCache keys
- add SessionsCache to the default table creation and deletion methods in Database.py
- update storeSessionsCache() and all the relevant db & sql code so it writes a sessionId to HP
2010-12-02 01:58:02 -05:00
Worros
19a32943d8 Hand: Move assemble() function up into select() 2010-10-09 15:27:58 +08:00
Worros
a964b17de6 Merge branch 'chaz' of git://github.com/ChazDazzle/fpdb-chaz 2010-09-29 10:11:16 +08:00
Chaz
76b2dec2b6 * updated _addRaise() so that it does in fact accept the action variable 2010-09-28 17:33:15 -04:00
Chaz
0e9fb62b0d * added a call to the import_parameter 'saveActions' in Hand.py, saving it's value in the variable Hand.saveActions
* added logic to Hand.import() so that it only calls db.storeHandsActions if saveActions is true
* added logic to DetailedStats.getstats() so that it only calls assembleHandsActions() if saveActions is true
2010-09-28 17:17:15 -04:00
Chaz
a76e34598d * Modified storeHandsPlayers() so it returns a dictionary of handId & playerId to handPlayerIds
* Filled storeHandsActions() with the required information
* Updated Hand.insert so that it calls storeHandsActions() and added the variable dbid_hpid to receive the new dictionary
2010-09-28 17:09:24 -04:00
Chaz
94d4bf6ed5 * added ACTION dictionary for looking up actionId
* edited addAnte(), addBlind(), addCall(), addBet(), addBlind() (Draw), addDiscard() (Draw), 
addComplete() (Stud), and addBringIn() (Stud) to standardize element order and datatype
*  added a field to  _addRaise() which allows  addComplete() (Stud) to pass the 'compleates' action type
2010-09-28 16:50:33 -04:00
Worros
9e13930742 Hand: Whitespace changes from Forrest 2010-09-28 12:04:40 +08:00
Worros
dee17e8001 L10n: H->M updated 2010-09-23 14:10:30 +08:00