2008-08-04 05:44:28 +02:00
#!/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.
import sys
import MySQLdb
db = MySQLdb . connect ( " localhost " , " fpdb " , sys . argv [ 1 ] , " fpdb " )
cursor = db . cursor ( )
print " Connected to MySQL on localhost. Printing summary stats: "
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM Players " )
2008-08-04 05:44:28 +02:00
print " Players: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM Autorates " )
2008-08-04 05:44:28 +02:00
print " Autorates: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM Sites " )
2008-08-04 05:44:28 +02:00
print " Sites: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM Gametypes " )
2008-08-04 05:44:28 +02:00
print " Gametypes: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM Hands " )
2008-08-04 05:44:28 +02:00
print " Total Hands: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.type= ' ring ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Ring: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.type= ' stt ' " )
2008-08-04 05:44:28 +02:00
print " Hands, STT: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.type= ' mtt ' " )
2008-08-04 05:44:28 +02:00
print " Hands, MTT: " , cursor . rowcount
print " "
print " Hands per category and type "
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.limitType= ' cn ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Cap No Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.limitType= ' cp ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Cap Pot Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' holdem ' AND Gametypes.limitType= ' nl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Holdem No Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' holdem ' AND Gametypes.limitType= ' pl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Holdem Pot Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' holdem ' AND Gametypes.limitType= ' fl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Holdem Fixed Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' omahahi ' AND Gametypes.limitType= ' nl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Omaha Hi No Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' omahahi ' AND Gametypes.limitType= ' pl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Omaha Hi Pot Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' omahahi ' AND Gametypes.limitType= ' fl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Omaha Hi Fixed Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' omahahilo ' AND Gametypes.limitType= ' nl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Omaha Hi/Lo No Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' omahahilo ' AND Gametypes.limitType= ' pl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Omaha Hi/Lo Pot Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' omahahilo ' AND Gametypes.limitType= ' fl ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Omaha Hi/Lo Fixed Limit: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' razz ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Razz: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' studhi ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Stud Hi: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT Hands.id FROM Hands INNER JOIN Gametypes ON Hands.gametypeId = Gametypes.id WHERE Gametypes.category= ' studhilo ' " )
2008-08-04 05:44:28 +02:00
print " Hands, Stud Hi/Lo: " , cursor . rowcount
print " "
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM BoardCards " )
2008-08-04 05:44:28 +02:00
print " Board_cards: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM HandsPlayers " )
2008-08-04 05:44:28 +02:00
print " Hands_players: " , cursor . rowcount
2008-09-22 04:34:28 +02:00
cursor . execute ( " SELECT id FROM HandsActions " )
2008-08-04 05:44:28 +02:00
print " Hands_actions: " , cursor . rowcount
cursor . close ( )
db . close ( )