diff --git a/docs/install-in-windows.txt b/docs/install-in-windows.txt deleted file mode 100644 index 32fdc51f..00000000 --- a/docs/install-in-windows.txt +++ /dev/null @@ -1,95 +0,0 @@ -These instructions are for 32/64bit Windows NT/2k/XP/2k3/Vista/2k8. Well, in principle. I -made them in XP Pro, if you discover any differences or problems please let me know. If you're still on Win3/95/98/ME then you should switch to GNU/Linux, *BSD or WinXP. -Also see the other install-in-*.txt files. -The length of these instructions is due to MS refusal to provide any meaningful package management, but an installer will be made at some point. - -Here are direct download links, last checked 10Aug2008: -http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67-win32.zip/from/pick#mirrors -http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi -http://downloads.sourceforge.net/mysql-python/MySQL-python-1.2.2.win32-py2.5.exe?modtime=1173863337&big_mirror=0 -http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.12/gtk+-bundle-2.12.11.zip -http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.4/pycairo-1.4.12-1.win32-py2.5.exe -http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.14/pygobject-2.14.1-1.win32-py2.5.exe -http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.12/pygtk-2.12.1-2.win32-py2.5.exe - -1a. Install MySQL and do its basic setup -- Download Windows ZIP/Setup.exe -- Unzip the archive, execute the setup file - At the end make sure you activate that you want to configure it now. - Use the advanced/detailed config. Leave everything as default unless stated below, or unless you know what you're doing. - Make sure to DEACTIVATE TCP/IP networking, unless you want that and know how to secure it - Set a root password. Note that this is NOT the account/pw that fpdb will use. Also note that this is NOT a system account - you can't login to Windows with this, it is only for the database. - -Once finished it shold confirm "service started successfully" - -1b. MySQL database and user setup -Now open a shell (aka command prompt aka DOS window): -Click Start, then Run. In the opening window type "cmd" (without the inverted commas) and then click OK. A window with a black background should open. - -Type (replacing yourPassword with the root password for MySQL you specified during installation): -mysql --user=root --password=yourPassword - -It should say something like this: -Welcome to the MySQL monitor. Commands end with ; or \g. -Your MySQL connection id is 4 -Server version: 5.0.60-log Gentoo Linux mysql-5.0.60-r1 - -Type 'help;' or '\h' for help. Type '\c' to clear the buffer. - -mysql> - - -Now create the actual database. The default name is fpdb, I recommend you keep it. Type this: -CREATE DATABASE fpdb; - -Next you need to create a user. I recommend you use the default fpdb. Type this (replacing newPassword with the password you want the fpdb user to have - this can, but for security shouldn't, be the same as the root mysql password): -GRANT ALL PRIVILEGES ON fpdb.* TO 'fpdb'@'localhost' IDENTIFIED BY 'newPassword' WITH GRANT OPTION; - -Exit mysql by pressing Ctrl+D - -2. Install python -Get the latest Windows installer. As of this writing that is 2.5.2. Double click the .msi file to start installation and follow the prompts. - - -3. Install the Python-DBAPI package for MySQL: -Get the package and double click to install. - - -4. Time for GTK+ - here's the instructions from their bundle - -To use it, create some empty folder like c:\gtk . Using either -Windows Explorer's built-in zip file management, or the command-line -unzip.exe from -ftp://tug.ctan.org/tex-archive/tools/zip/info-zip/WIN32/unz552xN.exe -unzip this bundle. - -Then add the bin folder to your PATH. Make sure you have no other -versions of GTK+ in PATH. -To do that: -Right click on "My Computer" ("Arbeitsplatz" in German Windows) on the Desktop or in (Windows) Explorer. Select Properties. Then click on the tab Advanced and then you should see Environment Variables. Simply append GTK's bin folder to the existing PATH (make sure to put a ; between the old PATH and GTK's folder to seperate the entries in this list). - -5. Install pycairo, pygobject and pygtk with double click. - -6. Copy the default.conf from the docs folder to the appropriate folder in your system, e.g. C:\Documents and Settings\Nick\Application Data\fpdb\profiles\default.conf - -Now edit the file, in particular you will always have to type in the correct password (insecure, I know) and if you differ from the default setup you may need to change host, database or user. - -7. Double click fpdb.py in the pyfpdb folder of where you downloaded/unpacked it to. -When the program started open the menu Database and click "Create or Recreate Tables". - -That's it! Now you can use the bulk importer and the table viewer, more's coming. See readme-user.txt - -A word on privelege separation: fpdb should not require root/Administrator rights to run. If it does it is a bug or serious misconfiguration, please let us know. - -License -======= -Trademarks of third parties have been used under Fair Use or similar laws. - -Copyright 2008 Steffen Jobbagy-Felso -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 - -The program itself is licensed under AGPLv3, see agpl-3.0.txt diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index ecb4ead3..635d01cc 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -4,8 +4,6 @@ Everything is subject to change and especially the order will often change. Patc alpha2 (release by 17Aug) ====== change config file to windows line endings -add sf.net logo to webpage -change tabledesign VALIGN seperate and improve instructions for update expand instructions for profile file add instructions for mailing list to contacts @@ -14,6 +12,8 @@ re-run existing regression tests alpha3 ====== +add sf.net logo to webpage +change tabledesign VALIGN finish updating filelist finish todos in git instructions make sure totalProfit shows actual profit rather than winnings. diff --git a/docs/tabledesign.html b/docs/tabledesign.html index 27145846..3a89ef9b 100644 --- a/docs/tabledesign.html +++ b/docs/tabledesign.html @@ -421,9 +421,9 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt

Position for which this row applies. In this table this can be B(BB), S(SB), D(Dealer/Button), C(Cutoff), M(Middle - the 3 before cutoff) or E (Early - the 3 before Middle)

-

tourneysGametypeId

+

tourneyTypeId

smallint

-

References TourneysGametypes.id

+

References TourneyTypes.id

@@ -777,9 +777,9 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt


-

tourneysGametypeId

+

tourneyTypeId

smallint

-

References TourneysGametypes.id

+

References TourneyTypes.id

siteTourneyNo

@@ -813,7 +813,7 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt


-

Table TourneyGametypes

+

Table TourneyTypes

diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index fa9bc510..a2c59f84 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -370,7 +370,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) - self.window.set_title("Free Poker DB - version: alpha1+, p51") + self.window.set_title("Free Poker DB - version: alpha1+, p52") self.window.set_border_width(1) self.window.set_size_request(1020,400) self.window.set_resizable(True) diff --git a/pyfpdb/fpdb_db.py b/pyfpdb/fpdb_db.py index 06eb1005..0fa0dbc7 100644 --- a/pyfpdb/fpdb_db.py +++ b/pyfpdb/fpdb_db.py @@ -47,7 +47,7 @@ class fpdb_db: try: self.cursor.execute("SELECT * FROM Settings") settings=self.cursor.fetchone() - if settings[0]!=50: + if settings[0]!=52: print "outdated or too new database version - please recreate tables" except:# _mysql_exceptions.ProgrammingError: print "failed to read settings table - please recreate tables" @@ -126,7 +126,9 @@ class fpdb_db: self.cursor.execute("DROP TABLE IF EXISTS Tourneys;") self.cursor.execute("DROP TABLE IF EXISTS Players;") self.cursor.execute("DROP TABLE IF EXISTS Gametypes;") - self.cursor.execute("DROP TABLE IF EXISTS TourneysGametypes;") + if oldDbVersion>45 and oldDbVersion<=51: + self.cursor.execute("DROP TABLE IF EXISTS TourneysGametypes;") + self.cursor.execute("DROP TABLE IF EXISTS TourneyTypes;") self.cursor.execute("DROP TABLE IF EXISTS Sites;") self.db.commit() @@ -213,7 +215,7 @@ class fpdb_db: card5Value smallint, card5Suit char(1))""") - self.create_table("""TourneysGametypes ( + self.create_table("""TourneyTypes ( id SMALLINT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id), siteId SMALLINT UNSIGNED, FOREIGN KEY (siteId) REFERENCES Sites(id), buyin INT, @@ -223,7 +225,7 @@ class fpdb_db: self.create_table("""Tourneys ( id INT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id), - tourneysGametypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneysGametypeId) REFERENCES TourneysGametypes(id), + tourneyTypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id), siteTourneyNo BIGINT, entries INT, prizepool INT, @@ -288,7 +290,7 @@ class fpdb_db: playerId INT UNSIGNED, FOREIGN KEY (playerId) REFERENCES Players(id), activeSeats SMALLINT, position CHAR(1), - tourneysGametypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneysGametypeId) REFERENCES TourneysGametypes(id), + tourneyTypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id), HDs INT, street0VPI INT, @@ -351,10 +353,10 @@ class fpdb_db: street4CheckCallRaiseChance INT, street4CheckCallRaiseDone INT)""") - self.cursor.execute("INSERT INTO Settings VALUES (50);") + self.cursor.execute("INSERT INTO Settings VALUES (52);") self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"Full Tilt Poker\", 'USD');") self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"PokerStars\", 'USD');") - self.cursor.execute("INSERT INTO TourneysGametypes (id) VALUES (DEFAULT);") + self.cursor.execute("INSERT INTO TourneyTypes (id) VALUES (DEFAULT);") self.db.commit() print "finished recreating tables" #end def recreate_tables diff --git a/pyfpdb/fpdb_parse_logic.py b/pyfpdb/fpdb_parse_logic.py index 8912fc07..aa644a0c 100644 --- a/pyfpdb/fpdb_parse_logic.py +++ b/pyfpdb/fpdb_parse_logic.py @@ -44,7 +44,11 @@ def mainParser(db, cursor, site, category, hand): fee=fpdb_simple.parseFee(hand[0]) entries=-1 #todo: parse this prizepool=-1 #todo: parse this + knockout=0 tourneyStartTime=handStartTime #todo: read tourney start time + rebuyOrAddon=fpdb_simple.isRebuyOrAddon(hand[0]) + + tourneyTypeId=fpdb_simple.recogniseTourneyTypeId(cursor, siteID, buyin, fee, knockout, rebuyOrAddon) fpdb_simple.isAlreadyInDB(cursor, gametypeID, siteHandNo) #part 2: classify lines by type (e.g. cards, action, win, sectionchange) and street @@ -110,16 +114,13 @@ def mainParser(db, cursor, site, category, hand): hudImportData=fpdb_simple.generateHudData(playerIDs, category, actionTypes, actionTypeByNo, winnings, totalWinnings, positions) if isTourney: - raise fpdb_simple.FpdbError ("tourneys are currently broken") - payin_amounts=fpdb_simple.calcPayin(len(names), buyin, fee) ranks=[] for i in range (len(names)): ranks.append(0) - knockout=0 - entries=-1 - prizepool=-1 + payin_amounts=fpdb_simple.calcPayin(len(names), buyin, fee) + if (category=="holdem" or category=="omahahi" or category=="omahahilo"): - result = fpdb_save_to_db.tourney_holdem_omaha(cursor, category, siteTourneyNo, buyin, fee, knockout, entries, prizepool, tourneyStartTime, payin_amounts, ranks, + result = fpdb_save_to_db.tourney_holdem_omaha(cursor, category, siteTourneyNo, buyin, fee, knockout, entries, prizepool, tourneyStartTime, payin_amounts, ranks, tourneyTypeId, siteID, siteHandNo, gametypeID, handStartTime, names, playerIDs, startCashes, positions, cardValues, cardSuits, boardValues, boardSuits, winnings, rakes, actionTypes, actionAmounts, actionNos, hudImportData, maxSeats, tableName, seatNos) elif (category=="razz" or category=="studhi" or category=="studhilo"): raise fpdb_simple.FpdbError ("stud/razz are currently broken") diff --git a/pyfpdb/fpdb_save_to_db.py b/pyfpdb/fpdb_save_to_db.py index d9ca0076..be5e35bd 100644 --- a/pyfpdb/fpdb_save_to_db.py +++ b/pyfpdb/fpdb_save_to_db.py @@ -39,15 +39,7 @@ def ring_stud(cursor, category, site_hand_no, gametype_id, hand_start_time, def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_time, names, player_ids, start_cashes, positions, card_values, card_suits, board_values, board_suits, winnings, rakes, action_types, action_amounts, actionNos, hudImportData, maxSeats, tableName, seatNos): """stores a holdem/omaha hand into the database""" - - #fill up the two player card arrays - if (category=="holdem"): - fpdb_simple.fillCardArrays(len(names), 2, card_values, card_suits) - elif (category=="omahahi" or category=="omahahilo"): - fpdb_simple.fillCardArrays(len(names), 4, card_values, card_suits) - else: - raise fpdb_simple.FpdbError ("invalid category: category") - + fpdb_simple.fillCardArrays(len(names), category, card_values, card_suits) fpdb_simple.fill_board_cards(board_values, board_suits) hands_id=fpdb_simple.storeHands(cursor, site_hand_no, gametype_id, hand_start_time, names, tableName, maxSeats) @@ -62,21 +54,13 @@ def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_ti return site_hand_no #end def ring_holdem_omaha -def tourney_holdem_omaha(cursor, category, site_tourney_no, buyin, fee, knockout, entries, prizepool, tourney_start, payin_amounts, ranks, #end of tourney specific params - site_hand_no, gametype_id, hand_start_time, names, player_ids, start_cashes, positions, card_values, card_suits, board_values, board_suits, winnings, rakes, action_types, action_amounts, actionNos, hudImportData): +def tourney_holdem_omaha(cursor, category, site_tourney_no, buyin, fee, knockout, entries, prizepool, tourney_start, payin_amounts, ranks, tourneyTypeId, siteId, #end of tourney specific params + site_hand_no, gametype_id, hand_start_time, names, player_ids, start_cashes, positions, card_values, card_suits, board_values, board_suits, winnings, rakes, action_types, action_amounts, actionNos, hudImportData, maxSeats, tableName, seatNos): """stores a tourney holdem/omaha hand into the database""" - #fill up the two player card arrays - if (category=="holdem"): - fpdb_simple.fillCardArrays(len(names), 2, card_values, card_suits) - elif (category=="omahahi" or category=="omahahilo"): - fpdb_simple.fillCardArrays(len(names), 4, card_values, card_suits) - else: - raise fpdb_simple.FpdbError ("invalid category: category") - + fpdb_simple.fillCardArrays(len(names), category, card_values, card_suits) fpdb_simple.fill_board_cards(board_values, board_suits) - tourney_id=fpdb_simple.store_tourneys(cursor, site_id, site_tourney_no, buyin, fee, knockout, entries, prizepool, tourney_start) - + tourney_id=fpdb_simple.store_tourneys(cursor, siteId, site_tourney_no, buyin, fee, knockout, entries, prizepool, tourney_start) tourneys_players_ids=fpdb_simple.store_tourneys_players(cursor, tourney_id, player_ids, payin_amounts, ranks, winnings) hands_id=fpdb_simple.storeHands(cursor, site_hand_no, gametype_id, hand_start_time, names) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 602b1852..8416bcbb 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -250,12 +250,17 @@ def fill_board_cards(board_values, board_suits): board_suits.append("x") #end def fill_board_cards -def fillCardArrays(player_count, card_count, card_values, card_suits): -#fills up the two card arrays - #print "fillCardArrays, player_count:", player_count," card_count:",card_count - #print "card_values:",card_values +def fillCardArrays(player_count, category, card_values, card_suits): + """fills up the two card arrays""" + if (category=="holdem"): + cardCount=2 + elif (category=="omahahi" or category=="omahahilo"): + cardCount=4 + else: + raise fpdb_simple.FpdbError ("invalid category: category") + for i in range (player_count): - while (len(card_values[i])Installing in Windows -

These instructions are for 32/64bit Windows NT/2k/XP/2k3/Vista/2k8. Well, in principle. I made them in XP Pro, if you discover any differences or problems please let me know. If you're still on Win3/95/98/ME then you should switch to GNU/Linux, *BSD or WinXP. Also see the installation pages for other plataforms.
-
-The length of these instructions is due to MS refusal to provide any kind of package management.
-
-Here are direct download links from 10Aug2008:
+

These instructions are for 32/64bit Windows NT/2k/XP/2k3/Vista/2k8. Well, in principle. I +made them in XP Pro, if you discover any differences or problems please let me know. If you're still on Win3/95/98/ME then you should switch to GNU/Linux, *BSD or WinXP.
+The length of these instructions is due to MS refusal to provide any meaningful package management, but an installer will be made at some point.

+

Here are direct download links, last checked on 10Aug2008:
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67-win32.zip/from/pick#mirrors
http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi
http://downloads.sourceforge.net/mysql-python/MySQL-python-1.2.2.win32-py2.5.exe?modtime=1173863337&big_mirror=0
@@ -38,7 +37,7 @@ Once finished it shold confirm "service started successfully"

1b. MySQL database and user setup
Now open a shell (aka command prompt aka DOS window):
-Click Start, then Run. In the opening window type "cmd" (without the inverted commas) and then click OK. A windows with a black background should open.
+Click Start, then Run. In the opening window type "cmd" (without the inverted commas) and then click OK. A window with a black background should open.

Type (replacing yourPassword with the root password for MySQL you specified during installation):
mysql --user=root --password=yourPassword
@@ -66,9 +65,7 @@ Get the latest Windows installer. As of this writing that is 2.5.2. Double click 3. Install the Python-DBAPI package for MySQL:
Get the package and double click to install.

-4. In MySQL create a new database fpdb and a user by the same name. Set a password. I did this in webmin. Then set permissions for that user to: Select | Insert | Update | Delete | Create | Drop
-
-5. Time for GTK+ - here's the instructions from their bundle
+4. Time for GTK+ - here's the instructions from their bundle

To use it, create some empty folder like c:\gtk . Using either
Windows Explorer's built-in zip file management, or the command-line
@@ -81,17 +78,17 @@ versions of GTK+ in PATH.
To do that:
Right click on "My Computer" ("Arbeitsplatz" in German Windows) on the Desktop or in (Windows) Explorer. Select Properties. Then click on the tab Advanced and then you should see Environment Variables. Simply append GTK's bin folder to the existing PATH (make sure to put a ; between the old PATH and GTK's folder to seperate the entries in this list).

-6. Install pycairo, pygobject and pygtk with double click.
+5. Install pycairo, pygobject and pygtk with double click.

-7. Copy the default.conf from the docs folder to the appropriate folder in your system, e.g. C:\Documents and Settings\Nick\Application Data\fpdb\profiles\default.conf
+6. Copy the default.conf from the docs folder to the appropriate folder in your system, e.g. C:\Documents and Settings\Nick\Application Data\fpdb\profiles\default.conf

Now edit the file, in particular you will always have to type in the correct password (insecure, I know) and if you differ from the default setup you may need to change host, database or user.

-8. Double click fpdb.py in the pyfpdb folder of where you downloaded/unpacked it to.
+7. Double click fpdb.py in the pyfpdb folder of where you downloaded/unpacked it to.
When the program started open the menu Database and click "Create or Recreate Tables".

That's it! Now you can use the bulk importer and the table viewer, more's coming. See readme-user.txt
-
+A word on privelege separation: fpdb should not require root/Administrator rights to run. If it does it is a bug or serious misconfiguration, please let us know.
License
=======
Trademarks of third parties have been used under Fair Use or similar laws.

Field name