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:
Executable
+61
@@ -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)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user