git9 - (tables slightly changed) started PrintPlayerFlag - it does the command line parsing and prints the input' data and the selected ids.

Changed tabledesign type possibilities from cash/tour to ring/tour to match importer. if anyone has code broken by this send it in and ill fix it. also cleaned the html a bit more.
This commit is contained in:
steffen123 2008-08-04 23:03:13 +01:00
parent 7af8bb922a
commit 2ed82c58ee
4 changed files with 91 additions and 54 deletions

View File

@ -1,8 +1,12 @@
todolist (db=database, imp=importer, tv=tableviewer)
before alpha
===========
add back turn, river and stud functionality to hud and import-HudData
============
PrintPlayerFlag
imp/tv bug: PFR is blatantly crazy
imp(?) bug: handcount is only about 1/2 of what it should be
verify at least one PrintPlayerFlags
and stud functionality to hud and import-HudData
db+imp+tv WtSD (went to showdown)
db+imp+tv W$SD (won $ when seeing showdown - partial win counts partially here)
db+imp+tv WwSF (Won when seen flop - partial taken into account)
@ -17,12 +21,14 @@ tourney bug: fails with tuple error in recogniseplayerid
config wizard
catch index error, type error, file not found error
update install instructions
split python requirements, get deep links for windows DL for everything
implement error file in importer
remove mysql/myisam support.
before beta
===========
file permission script, use games group
change stud street storage from 3-7 to 0-4 throughout
make bulk importer display a grand total in the GUI
change save_to_db into one method and probably move into parse_logic

View File

@ -7,42 +7,21 @@
<BODY LANG="en-GB">
<P>see commit comments for version info</P>
<P>Direct suggestions, praise and animal names to steffen@sycamoretest.info</P>
<p>TODO clean all the crap out of this like i did in HudData</p>
<P>I decided to be generous on the sizes of the types - if computing
experience shows one thing then its that it will come back to bite
you in the ass if you save 2 bits in the wrong place. If performance
and/or db size are too bad we can still shrink some fields.</P>
<p>Relationships
are noted in the comment (need to double check that all are listed)</P>
<p>If
you want more comments or if anything is confusing or bad let me
know.</P>
<p><BR>
</P>
<p>All
money/cash amounts are stored in cents/pennies/whatever (e.g. $4.27
would be stored a 427). Chips are stored as-is (e.g. 3675 chips would
be stored as 3675).</P>
<p><BR>
</P>
<p>Support
for ringgames in Holdem, Omaha, Razz and Stud complete. Support for
SnG/MTT is alpha</P>
<p><BR>
</P>
<p>Notes
on use/editing:</P>
<p>Any
change to this must be carried to to the table creation code unless it
is clearly noted in appropriate places.</P>
<P>If the code (in particular the importer) and this document disagree then this document is to be considered authorative. Please report such mismatches to steffen@sycamoretest.org or through sourceforge.</P>
<p>TODO clean all the crap out of this like i did in HudData, line39 onwards</p>
<P>I decided to be generous on the sizes of the types - if computing experience shows one thing then its that it will come back to bite you in the ass if you save 2 bits in the wrong place. If performance and/or db size are too bad we can still shrink some fields.</P>
<p>Relationships are noted in the comment (need to double check that all are listed)</P>
<p>If you want more comments or if anything is confusing or bad let me know.</P>
<p>All money/cash amounts are stored in cents/pennies/whatever (e.g. $4.27 would be stored a 427). Chips are stored as-is (e.g. 3675 chips would be stored as 3675).</P>
<p>Support for ringgames in Holdem, Omaha, Razz and Stud complete. Support for SnG/MTT is alpha</P>
<p>Notes on use/editing:</P>
<p>Any change to this must be carried to to the table creation code in fpdb_db.py or at least an entry to known bugs is to be made.</P>
<P>If the code (in particular the importer) and this document disagree then this document is to be considered authorative. Please report such mismatches to steffen@sycamoretest.org or through an assembla ticket.</P>
<p><b>License</b><br>
Trademarks of third parties have been used under Fair Use or similar laws.<br>
Copyright 2008 Steffen Jobbagy-Felso<br>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 as published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found in fdl-1.2.txt<br>
The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<p>See
readme.txt for copying</P>
<p>See readme.txt for copying</P>
<p><BR>
</P>
<p><B>Table
@ -54,16 +33,9 @@ players</B></P>
<TD><P>Comment</P></TD>
</TR>
<TR VALIGN=TOP>
<TD>
<P>id</P>
</TD>
<TD>
<P>int</P>
</TD>
<TD>
<P><BR>
</P>
</TD>
<TD><P>id</P></TD>
<TD><P>int</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP>
<TD>
@ -266,18 +238,12 @@ gametypes</B></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD><P>type</P></TD>
<TD><P>char(4)</P></TD>
<TD>
<P>type</P>
</TD>
<TD>
<P>char(4)</P>
</TD>
<TD>
<p>valid
entries:</P>
<p>cash
- aka ringgames</P>
<P>tour - tournament</P>
<p>valid entries:</P>
<p>ring - ringgames aka cash games</P>
<P>tour - tournament incl SnG</P>
</TD>
</TR>
<TR VALIGN=TOP>

61
utils/PrintPlayerFlags.py Executable file
View File

@ -0,0 +1,61 @@
#!/usr/bin/python
#Copyright 2008 Steffen Jobbagy-Felso
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as published by
#the Free Software Foundation, version 3 of the License.
#
#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 Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#In the "official" distribution you can find the license in
#agpl-3.0.txt in the docs folder of the package.
#This is intended mostly for regression testing
import sys
import MySQLdb
from optparse import OptionParser
import fpdb_util_lib as ful
parser = OptionParser()
parser.add_option("-b", "--bigblind", default="2", type="int", help="big blinds in cent")
parser.add_option("-c", "--cat", "--category", default="holdem", help="Category, e.g. holdem or studhilo")
parser.add_option("-g", "--gameType", default="ring", help="Whether its a ringgame (ring) or a tournament (tour)")
parser.add_option("-l", "--limit", "--limitType", default="fl", help="Limit Type, one of: nl, pl, fl, cn, cp")
parser.add_option("-n", "--name", "--playername", default="Player_1", help="Name of the player to print")
parser.add_option("-p", "--password", help="The password for the MySQL user")
parser.add_option("-s", "--site", default="PokerStars", help="Name of the site (as written in the history files)")
(options, sys.argv) = parser.parse_args()
db = MySQLdb.connect("localhost", "fpdb", options.password, "fpdb")
cursor = db.cursor()
print "Connected to MySQL on localhost. Print Player Flags Utility"
print "Basic Data"
print "=========="
print "bigblind:",options.bigblind, "category:",options.cat, "limitType:", options.limit, "name:", options.name, "gameType:", options.gameType, "site:", options.site
cursor.execute("SELECT id FROM sites WHERE name=%s", (options.site,))
siteId=cursor.fetchone()[0]
cursor.execute("SELECT id FROM gametypes WHERE big_blind=%s AND category=%s AND site_id=%s AND limit_type=%s AND type=%s", (options.bigblind, options.cat, siteId, options.limit, options.gameType))
gametypeId=cursor.fetchone()[0]
cursor.execute("SELECT id FROM players WHERE name=%s", (options.name,))
playerId=cursor.fetchone()[0]
print "siteId:", siteId, "gametypeId:", gametypeId, "playerId:", playerId
cursor.close()
db.close()
sys.exit(0)

View File

@ -15,6 +15,8 @@
#In the "official" distribution you can find the license in
#agpl-3.0.txt in the docs folder of the package.
echo "Please note for this to really work you need to work on an empty database"
rm ../testdata/*.found.txt
../pyfpdb/fpdb_import.py -p$1 --file=../testdata/ps-holdem-ring-001to003.txt -x
../pyfpdb/fpdb_import.py -p$1 --file=../testdata/ps-holdem-ring-001to003.txt -x
@ -28,6 +30,8 @@ echo "it should've reported first that it stored 3, then that it had 3 duplicate
./print_hand.py -p$1 --hand=14519420999 > ../testdata/ps.14519420999.found.txt && colordiff ../testdata/ps.14519420999.found.txt ../testdata/ps.14519420999.expected.txt
./print_hand.py -p$1 --hand=14519433154 > ../testdata/ps.14519433154.found.txt && colordiff ../testdata/ps.14519433154.found.txt ../testdata/ps.14519433154.expected.txt
./PrintPlayerFlags.py -p$1 > ../testdata/ps-flags-3hands.found.txt && colordiff ../testdata/ps-flags-3hands.found.txt ../testdata/ps-flags-3hands.expected.txt
#./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6367428246 > ../testdata/ftp.6367428246.found.txt && colordiff ../testdata/ftp.6367428246.found.txt ../testdata/ftp.6367428246.expected.txt
#./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929537410 > ../testdata/ftp.6929537410.found.txt && colordiff ../testdata/ftp.6929537410.found.txt ../testdata/ftp.6929537410.expected.txt