Commit Graph

295 Commits

Author SHA1 Message Date
Steffen Schaumburg
828dce7ebe fix to make it work without save actions again, by chaz 2011-02-28 02:01:06 +01: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
Worros
2e6bec5c18 Hand: Add fake GBP symbol 2010-09-19 00:14:14 +08:00
Worros
ebcd9f0b66 Hand: Remove error message 2010-09-14 14:15:23 +08:00
Worros
1a7b1caf48 Hand: Remove non-standard exception handler
That code should either crash or raise a FpdbParse* exception which will be caught at a higher level
2010-09-14 13:53:47 +08:00
Worros
e1bb9a602b Stars/Hand: Fix issue produced by last regression test file
7-Stud-USD-0.04-0.08-200907.Missing.Showdown.Card.txt only contains 6 showdown cards.

Put filthy hack in addShownCards to guard against this condition, and add a commented out debug print in the HHC
2010-09-09 13:19:19 +08:00
Worros
304c9e71a2 Hand: Wrap Pot.end() section in exception handler
If Hand.end() fails in that section, then something is seriously wrong with either action parsing or stack parsing.

Throw a parse error in the hopes we can continue on.
2010-09-02 14:02:19 +08:00
Worros
7aeb5e4531 Merge branch 'master' of git://git.assembla.com/fpdb-sql 2010-09-01 11:08:04 +08:00
Worros
9a3d60e0b3 HandsActions: Stub in the remaining calls for HandsActions 2010-09-01 10:47:13 +08:00
sqlcoder
06b34e8648 clarify difference between site and filter to allow 2 sites from same network, prompt to add site to db if missing 2010-08-31 22:44:41 +01:00
sqlcoder
536adad477 merge from Steffen/Carl 2010-08-29 00:05:22 +01:00
sqlcoder
6e3953e774 add hand ID to warning message 2010-08-28 23:57:04 +01:00
steffen123
6505334ac6 Merge branch 'carl' 2010-08-26 18:20:38 +02:00