diff --git a/packaging/announce-0.21-rc1.txt b/packaging/announce-0.21-rc1.txt new file mode 100644 index 00000000..b9d3b7b3 --- /dev/null +++ b/packaging/announce-0.21-rc1.txt @@ -0,0 +1,93 @@ +Hello everyone, +The new release candidate 0.21-rc1 is now available for download as source or as packages/installers for Debian, Gentoo, Ubuntu and Windows. +This version brings many improvements and bugfixes, updating is recommended for users of snapshots. If you're using a stable version like 0.20 or 0.20.1 please consider trying this version and report any bugs, and in particular regressions, so we can fix them. There've been many many bugfixes and quite a few new features (details further down, download links at the end of this post). + +So... what is FPDB? +=================== +FPDB (Free Poker Database) is a free/open source suite of steadily growing tools to track and analyse your online poker game. FPDB is able to import the hand histories that poker sites write to your computer, store additional data from each hand in a database for use in later analysis. + +FPDB is ambitious, intending to support all games. Currently we support flop based games (Hold’em, Omaha, Omaha Hi/Lo), stud games (7 Card Stud, 7 Card Stud Hi/Lo, and Razz) and draw games (Triple Draw Lowball, 5 Card Draw) on several poker sites. + +FPDB provides a Heads Up Display (HUD), Profit Grapher and Stats viewers with a list of features that is growing. + +What's changed +============== +448 changesets (excl. merges) have gone in since 0.20.906. +* Stat fixes: Steal, 3bet, cbet all made more accurate. Should work for Stud, Draw and Flop games +* New site support: Winamax. +* Draw support for FTP (preliminary - still need hand histories for A-5 lowball) +* Improved Player Stats view for Razz - http://sourceforge.net/apps/wordpres...art-card-list/ +* Additional BB option in the grapher for cash games - http://sourceforge.net/apps/wordpres...-improvements/ +* Tournament results import ability for Stars +* Tournament results graphing. - http://sourceforge.net/apps/wordpres...esults-graphs/ +* Many, many bug fixes. +* Better support for timezones. +* The OnGame converter had a significant refresh. Betfair users should now use the OnGame importer. +* The Merge/Carbon converter received a significant update. +* Stars.fr and Stars.it hand histories now import correctly (including the new AAMS id on Stars.it) +* Stars cap games should no longer crash. +* Street-by-street actions are now stored for imported hands +* Bulk import now has a file by file progress bar. +* HUD auto closes when client is closed on all systems +* HUD follows when the client is dragged on all systems + +Where to get it +=============== +Please note that you will have to either recreate your database or use a new one if you're updating from 0.20.906 or older. +Config files from 0.20 and later should work. Please report if you have problems with config files from that version or later. +To download: http://sourceforge.net/projects/fpdb...pdb/Snapshots/ +To be notified by email of new versions you can subscribe to our announce mailing list here: https://lists.sourceforge.net/lists/.../fpdb-announce + +Links +===== +Link to FPDB website (wiki) http://fpdb.wiki.sourceforge.net/ +Features page: http://sourceforge.net/apps/mediawik...title=Features +Installation instructions are available from: http://sourceforge.net/apps/mediawik...e=Installation +Getting Started Instructions: http://sourceforge.net/apps/mediawik...etting_Started +FAQ: http://sourceforge.net/apps/mediawik...sked_Questions +Screenshots: http://sourceforge.net/apps/mediawik...le=Screenshots + +How to help +=========== +Tournament results are getting attention in the development tree at the moment, if you have an interest in assisting this, for the next release please send some summary files or emails to fpdb-main@lists.sourceforge.net. By this I mean files that are created automatically by some sites for each tourney. Other sites send email summaries automatically or on request, we need those too. If you are going to send through those summaries, please avoid copy&paste as email has a habit of converting the original text into something else. Please either forward the email or zip the file and attach to an email before sending. + +How to get help +=============== +Please see the "Bug reports" section below to enable us to help you +1) Chat/IRC +One of the developers is usually around, it is IRC - we may take a while to actually respond - dont get discouraged because we didn't answer within 10 minutes, once we do you've probably got our full attention. +This link takes you to a website where you can talk to us directly, alternatively use an IRC client to connect to #fpdb on freenode: http://webchat.freenode.net/?channels=fpdb +2) Mailing List +Visit http://lists.sourceforge.net/lists/listinfo/fpdb-main to subscribe and send us an email +3) The monster 2+2 forum thread (registration reqd). +http://forumserver.twoplustwo.com/16...2009-a-273001/ Please dont let the size of the thread phase you. It is monitored and sends email notifications to the developers. (Note: If you play poker and don't frequent the 2+2 forums, you may want to become better acquainted. Its a bit daunting at first, but well worth the effort) + +Bug reports +=========== +When you do report issues, please help us help you. We usually need at least the following information: +- Operating system and version (e.g. Ubuntu 10.10 or Windows XP) +- Database type (MySQL, SQLite, PostgreSQL) +- Install method (exe, tarball, deb, git) +- Fpdb version +- Site name and gametype (e.g. Razz SnG) +You can find many of these details for easy copy&paste in the Help menu under About. + +Known Bugs +========== +Windows 7 file names for EUR Stars hand histories crashes fpdb. +HUD: +* Position of HUD overlay based on favourite position is off after you get moved in a tournament. +* No HUD support for mixed games. +* HUD doesn't handle tournament table changes well. Work around by closing the HUD for that table and letting it regenerate. +* To close down the HUD, always use the "stop autoimport" button from the main FPDB application. Closing the "HUD main window" directly may cause temporary loss of control of other applications (including the poker client). Control is normally returned at the next hud update cycle or if FPDB is stopped. +* Windows 7 and Windows Vista require that fpdb.pyw be 'Run as Admin' - the HUD will not run using the run_fpdb.bat startup script. + +Thanks +====== +An open source project lives and dies around the communities of people it attracts to help out. +Thanks too: +Devs and contributors - Steffen123, Sqlcoder, Eric Blade, Eratosthenes, Bostik, MCT, Grindi, PassThePeas, Gimick, Kangaderoo, ChazDazzle. +Special shoutout to Eleatic Stranger who has written an initial converter for Carbon poker, without ever having played on the site! +Documentation: RSOAndrew, Buggernaut, ChazDazzle +Testers and everyone answering forum questions - xaviax, Dog, uncooper etc. You know who you are. +Hand History donations: Quite a few people on this list now. Every donation for alternate sites and various corner cases is appreciated. \ No newline at end of file diff --git a/packaging/announce-0.21-rc2.txt b/packaging/announce-0.21-rc2.txt new file mode 100644 index 00000000..7dde9364 --- /dev/null +++ b/packaging/announce-0.21-rc2.txt @@ -0,0 +1,89 @@ +Hello everyone, +The new release candidate 0.21-rc2 is now available for download as source or as packages/installers for Debian, Gentoo, Ubuntu and Windows. +This version brings many improvements and bugfixes, updating is recommended for users of snapshots and rc1. If you're using a stable version like 0.20 or 0.20.1 please consider trying this version and report any bugs, and in particular regressions, so we can fix them. This might be the last RC before the next stable. + +So... what is FPDB? +=================== +FPDB (Free Poker Database) is a free/open source suite of steadily growing tools to track and analyse your online poker game. FPDB is able to import the hand histories that poker sites write to your computer, store additional data from each hand in a database for use in later analysis. + +FPDB is ambitious, intending to support all games. Currently we support flop based games (Hold’em, Omaha, Omaha Hi/Lo), stud games (7 Card Stud, 7 Card Stud Hi/Lo, and Razz) and draw games (Triple Draw Lowball, 5 Card Draw) on several poker sites. + +FPDB provides a Heads Up Display (HUD), Profit Grapher and Stats viewers with a list of features that is growing. + +What's changed +============== +Approx. 200 changesets (excl. merges) have gone in since 0.21-rc1. Some of the improvements are: +* Various changes to the HUD to make it more reliable, especially in tournaments +* Initial preview of PokerEval/Stove - this is just a preview, it is not meant for productive use yet +* HUD now works on Mac OSX (note that it's not as "smooth" as on Linux&Windows) +* Improved handling of timezones +* Tournament support for Winamax +* Initial support for Party.FR +* Groundwork for much better session support (not user-visible yet) +* Some improvements to error handling +* Some new command line parameters +* Support for EUR games on some sites that didn't have it before +* Various other small things and under-the-hood work + +Where to get it +=============== +Please note that you will have to either recreate your database or use a new one if you're updating from 0.21-rc1 or older. +Config files from 0.20 and later should work. Please report if you have problems with config files from that version or later. +To download: http://sourceforge.net/projects/fpdb/files/fpdb/Snapshots/ +To be notified by email of new versions you can subscribe to our announce mailing list here: https://lists.sourceforge.net/lists/listinfo/fpdb-announce + +Links +===== +Link to FPDB website (wiki) http://fpdb.wiki.sourceforge.net/ +Features page: http://sourceforge.net/apps/mediawiki/fpdb/index.php?title=Features +Installation instructions are available from: http://sourceforge.net/apps/mediawiki/fpdb/index.php?title=Installation +Getting Started Instructions: http://sourceforge.net/apps/mediawiki/fpdb/index.php?title=Getting_Started +FAQ: http://sourceforge.net/apps/mediawiki/fpdb/index.php?title=FAQ +Screenshots: http://sourceforge.net/apps/mediawiki/fpdb/index.php?title=Screenshots + +How to help +=========== +Join us in IRC and say you want to do something :) + +How to get help +=============== +Please also see the "Bug reports" section below to enable us to help you. +These are listed in order of usefulness - the 2+2 thread in particular is rather chaotic so if we miss your post feel free to bring it up again +1) Chat/IRC +One of the developers is usually around, but it is IRC. Dont get discouraged because we didn't answer within 10 minutes, once we do you've probably got our full attention. +This link takes you to a website where you can talk to us directly, alternatively use an IRC client to connect to #fpdb on freenode: http://webchat.freenode.net/?channels=fpdb +2) Mailing List +Visit http://lists.sourceforge.net/lists/listinfo/fpdb-main to subscribe to the development&support mailing list and send us an email +3) The monster 2+2 forum thread (registration reqd). +http://forumserver.twoplustwo.com/16...2009-a-273001/ Please dont let the size of the thread phase you. It is monitored and sends email notifications to the developers. (Note: If you play poker and don't frequent the 2+2 forums, you may want to become better acquainted. Its a bit daunting at first, but well worth the effort) + +Bug reports +=========== +When you do report issues, please help us help you. We usually need at least the following information: +- Operating system and version (e.g. Ubuntu 10.10 or Windows XP) +- Database type (MySQL, SQLite, PostgreSQL) +- Install method (exe, tarball, deb, git, ebuild) +- Fpdb version +- Site name and gametype (e.g. Razz SnG) +You can find many of these details for easy copy&paste in the Help menu under About. + +Known Bugs +========== +Windows 7 file names for EUR Stars hand histories crashes fpdb. +HUD: +* Position of HUD overlay based on favourite position is off after you get moved in a tournament. +* No HUD support for mixed games. +* HUD doesn't handle tournament table changes well. Work around by closing the HUD for that table and letting it regenerate. +* To close down the HUD, always use the "stop autoimport" button from the main FPDB application. Closing the "HUD main window" directly may cause temporary loss of control of other applications (including the poker client). Control is normally returned at the next hud update cycle or if FPDB is stopped. +* Windows 7 and Windows Vista require that fpdb.pyw be 'Run as Admin' - the HUD will not run using the run_fpdb.bat startup script. + +Thanks +====== +An open source project lives and dies around the communities of people it attracts to help out. +First of all thanks to all the free/libre projects on whom we depend (in no particular order): Python, SQLite, mysql-python, MySQL, psycopg2, PostgreSQL, numpy, matplotlib, GTK/Cairo, PyGTK/PyCairo, python-xlib, pytz, X11&tools and pokereval/pypokereval/stove. Additionally most of us use free/libre software such as Gentoo Linux, Debian GNU/Linux, Ubuntu Linux, Arch Linux, git, gedit, kate, eclipse etc., thanks to all these people and everyone who's gone unnamed, too. +Thanks too: +Devs and contributors - Steffen123, Sqlcoder, Eric Blade, Eratosthenes, Bostik, MCT, Grindi, PassThePeas, Gimick, Kangaderoo, ChazDazzle. +Special shoutout to Eleatic Stranger who has written an initial converter for Carbon poker, without ever having played on the site! +Documentation: RSOAndrew, Buggernaut, ChazDazzle +Testers and everyone answering forum questions - xaviax, Dog, uncooper etc. You know who you are. +Hand History donations: Quite a few people on this list now. Every donation for alternate sites and various corner cases is appreciated. \ No newline at end of file diff --git a/packaging/debian/changelog b/packaging/debian/changelog index c09713a3..4c48b057 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,15 @@ +free-poker-tools (0.21~rc2) unstable; urgency=low + + * Second 0.21 release-candidate + + -- Mika Bostrom Tue, 28 Dec 2010 18:37:47 +0200 + +free-poker-tools (0.21~rc1) unstable; urgency=low + + * First 0.21 release candidate + + -- Mika Bostrom Mon, 06 Dec 2010 17:30:54 +0200 + free-poker-tools (0.20.906-1) unstable; urgency=low * New snapshot diff --git a/packaging/debian/control b/packaging/debian/control index c510e1c8..945b741e 100644 --- a/packaging/debian/control +++ b/packaging/debian/control @@ -11,9 +11,8 @@ Section: games Priority: extra Depends: ${python:Depends}, python-gtk2, python-matplotlib, python-support, python-xlib, - mysql-server | postgresql | python-pysqlite2, - python-psycopg2 | python-mysqldb -Suggests: wine + python-pysqlite2 +Suggests: wine, postgresql | mysql-server, python-psycopg2 | python-mysqldb Description: free poker database with HUD FPDB is a statistics tool for online poker. It supports most sites and several games. Most prominent feature is its heads-up display diff --git a/packaging/gentoo/current_testing.ebuild b/packaging/gentoo/current_testing.ebuild index 525200fb..d6940fe6 100644 --- a/packaging/gentoo/current_testing.ebuild +++ b/packaging/gentoo/current_testing.ebuild @@ -15,7 +15,7 @@ SLOT="0" KEYWORDS="~amd64 ~x86" #note: this should work on other architectures too, please send me your experiences -IUSE="graph mysql postgres sqlite linguas_hu" +IUSE="graph mysql postgres sqlite linguas_de linguas_hu linguas_fr" RDEPEND=" mysql? ( virtual/mysql dev-python/mysql-python ) @@ -28,7 +28,8 @@ RDEPEND=" graph? ( dev-python/numpy dev-python/matplotlib[gtk] ) dev-python/python-xlib - dev-python/pytz" + dev-python/pytz + x11-apps/xwininfo" DEPEND="${RDEPEND}" src_install() { diff --git a/packaging/gentoo/fpdb-9999.ebuild b/packaging/gentoo/fpdb-9999.ebuild index a2469183..3cab3be6 100644 --- a/packaging/gentoo/fpdb-9999.ebuild +++ b/packaging/gentoo/fpdb-9999.ebuild @@ -14,7 +14,7 @@ LICENSE="AGPL-3" SLOT="0" KEYWORDS="" -IUSE="graph mysql postgres sqlite linguas_de linguas_hu" +IUSE="graph mysql postgres sqlite linguas_de linguas_hu linguas_fr" RDEPEND=" mysql? ( virtual/mysql dev-python/mysql-python ) diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index 68a74c81..2762699e 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -30,14 +30,18 @@ py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2ex psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.1.win32-py2.6-pg8.4.3-release.exe (Note: stickpeople is the offical repository, not a community build) +(py)pokereval v138 ... http://sourceforge.net/projects/fpdb/files/fpdb/pypoker-eval-win32/pokereval-138.win32.exe/download +(Note: There are no official windows builds, this installer is built from source. A walkthrough is in the same directory as this walkthrough. + 1.2/ MySQL -MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe ... http://www.mediafire.com/file/iodnnnznmj1/MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe +Install the following file: -This is an intaller built from source by gimick. There are no official mysql-python2.6 builds for windows. +MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe ... http://sourceforge.net/projects/fpdb/files/fpdb/MySQL-python-1.2.3-win32-py2.6/MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe/download -Community builds are also available from some developers. see www.codegood.com for example. +Note: This is an intaller built from source by gimick. A walkthrough to build this installer is in the same directory as this walkthrough. +Note: There is no official mysql-python2.6 build for windows. Community builds are available from some developers. see www.codegood.com for example. 1.3/ pytz fixup to work in an executable package @@ -64,6 +68,26 @@ with this line: 1.3.4/ Save and exit +1.4/ Patch py2exe to stop popup runtime error message + +see http://www.py2exe.org/index.cgi/StderrLog for technical info. + +1.4.1/ + +dos> write C:\Python26\Lib\site-packages\py2exe\boot_common.py + +replace: + atexit.register(alert, 0, + "See the logfile '%s' for details" % fname, + "Errors occurred") +with: + #atexit.register(alert, 0, + # "See the logfile '%s' for details" % fname, + # "Errors occurred") + +1.4.2/ save and exit + + Step 2 Setup GTK ----------------- diff --git a/packaging/windows/pypokereval-win32-packaging-walkthrough.txt b/packaging/windows/pypokereval-win32-packaging-walkthrough.txt new file mode 100644 index 00000000..b0fbe5f9 --- /dev/null +++ b/packaging/windows/pypokereval-win32-packaging-walkthrough.txt @@ -0,0 +1,159 @@ +pypokereval packaging for fpdb project +-------------------------------------- + +Created by Gimick on 11th December 2010 +Content is available under the the GNU Affero General Public License version 3 + +Background +---------- + +The walktrough builds an unoffical python installer package for pypokereval. + +In a previous walkthrough, the pypokereval dll(pyd) was built from source. +In this walkthrough, we are going to generate a windows package which will allow +the sources to be installed through distutils onto a client computer + +The current situation is that there is no windows build or windows installer provided +by the package authors. + +Until a package is available, the fpdb project needs some method of providing a windows +installation for the pypokereval module. This walkthrough will therefore be obsolete once +an official package becomes available. + +Actually, for windows fpdb users, the majority will use a pre-built fpdb executable (which contains the +pypokereval package) Therefore, pypokereval installation will only be needed for two groups of people: + i) anyone wanting to build an fpdb package using py2exe + ii) anyone wanting to run fpdb on windows from source + +Credits +------- + +To loic@dachary.org at pokersource http://pokersource.sourceforge.net/ +To donn.ingle@gmail.com for the tutorial here ... http://wiki.python.org/moin/Distutils/Tutorial +Official python reference here ... http://docs.python.org/distutils/index.html + +Assumptions +----------- + +The underlying dll(pyd) and pokereval library is built for win32 x86 platform only, so we will assume +32bit only in this walkthrough. Contributions for a x86-64 build are most welcome. + +Similarly, the underlying package is built against the python 2-6 library and is valid only for that version. +The underlying package was not built with sse enabled, and therefore should work for legacy systems. + + +1. Install pre-requisites +------------------------- + +System used for building is winXP home + +1.1/ Install python runtime from here ... + +Python 2.6.5 ... http://www.python.org/ftp/python/2.6.5/python-2.6.5.msi + +1.2/ Grab pypokereval stuff from fpdb project here ... + +pypokereval ... http://sourceforge.net/projects/fpdb/files/fpdb/pypoker-eval-win32/dev/pypokereval-138-win32-py265-fpdb-1.1.exe/download + +1.3/ Double click the pypokereval-138-win32-py265-fpdb-1.1.exe and extract the folder to the desktop + + +2. Prepare a folder containing the items needing packaging +---------------------------------------------------------- + +dos>cd desktop +dos>mkdir temp +dos>cd temp +dos>mkdir pokereval +dos>cd pokereval + +dos>copy ..\..\pypokereval-138-win32-py265-fpdb-1.1\_pokereval_2_6.pyd +dos>copy ..\..\pypokereval-138-win32-py265-fpdb-1.1\pokereval.py + +dos>mkdir utils +dos>cd utils +dos>copy ..\..\..\pypokereval-138-win32-py265-fpdb-1.1\test.py +dos>cd .. + +The next step is to rename the pokereval.py file to __init__.py. The reason for doing this +is that site-packages require an __init__ file to be found when the module is imported at runtime +Inserting a dummy __init__.py which simply imports pokereval does not work, the reason being that the +PokerEval class is not seen by the caller. Syntax such as "from pokereval import PokerEval" +does not work unless the pokereval.py (which defines the PokerEval class) is renamed to __init__.py. + +dos> rename pokereval.py __init__.py + +3. Prepare the additional packaging files +----------------------------------------- + +dos>cd desktop +dos>cd temp + +3.1/ setup.py +------------- + +dos> edit setup.py + +Include the following python code: + +#================================================== + +from distutils.core import setup + +filelist = ["utils/*", "_pokereval_2_6.pyd"] + +setup(name = "pokereval", +version = "138", +description = "pypokereval installer (unofficial)", +author = "project fpdb", +author_email = "Fpdb-main@lists.sourceforge.net", +url = "fpdb.sourceforge.net", +packages = ['pokereval'], +package_data = {'pokereval' : filelist }, +long_description = """An unofficial and experimental installer for pypokereval v138 +Built for 32bit windows and python v2.6.5 +pokereval official project page is at http://www.pokersource.info/""" +) + +#================================================== + +3.2 / review directory tree +--------------------------- + +The following structure should now exist. + +temp + |--setup.py + |--pokereval + |--_pokereval_2_6.pyd + |--__init__.py + |--utils + |--test.py + + +3.3 Build +--------- + +Navigate to the desktop/temp directory + +dos>c:\Python26\python.exe setup.py bdist_wininst --plat-name=win32 --user-access-control force + +Note: UAC auto seems to cause lockup on my win7 system + +3.4 Complete +------------ + +The executable file pokereval-138.win32.exe will be in the newly-created dist folder. + +3.5 Install and test +-------------------- + +Double click to install +Navigate to c:\python26\lib\site-packages\pokereval\test + +execute dos>c:\Python26\python.exe test.py + +Output should scroll down the screen + + + diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index fa23f1cd..e3a8e82e 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -305,7 +305,8 @@ class Database: self.saveActions = False if self.import_options['saveActions'] == False else True if self.is_connected(): - self.get_sites() + if not self.wrongDbVersion: + self.get_sites() self.connection.rollback() # make sure any locks taken so far are released #end def __init__ @@ -1205,6 +1206,7 @@ class Database: self.create_tables() self.createAllIndexes() self.commit() + self.get_sites() print _("Finished recreating tables") log.info(_("Finished recreating tables")) #end def recreate_tables @@ -1694,11 +1696,15 @@ class Database: def storeHand(self, p, printdata = False): if printdata: - print "######## Hands ##########" + print _("######## Hands ##########") import pprint pp = pprint.PrettyPrinter(indent=4) pp.pprint(p) - print "###### End Hands ########" + print _("###### End Hands ########") + + # Tablename can have odd charachers + p['tableName'] = Charset.to_db_utf8(p['tableName']) + #stores into table hands: q = self.sql.query['store_hand'] @@ -2090,7 +2096,7 @@ class Database: if (game['type']=='ring'): line[0] = 1 # count ring hands if (game['type']=='tour'): line[1] = 1 # count tour hands if (game['type']=='ring'): line[2] = pdata[p]['totalProfit'] #sum of profit - if (game['type']=='ring'): line[3] = float(Decimal(pdata[p]['totalProfit'])/Decimal(bigBet)) #sum of big bets won + if (game['type']=='ring'): line[3] = 0 #float(Decimal(pdata[p]['totalProfit'])/Decimal(bigBet)) #sum of big bets won line[4] = startTime inserts.append(line) @@ -2163,7 +2169,7 @@ class Database: dup = True return dup - def getGameTypeId(self, siteid, game): + def getGameTypeId(self, siteid, game, printdata = False): c = self.get_cursor() #FIXME: Fixed for NL at the moment c.execute(self.sql.query['getGametypeNL'], (siteid, game['type'], game['category'], game['limitType'], game['currency'], @@ -2175,14 +2181,22 @@ class Database: hilo = "s" elif game['category'] in ['razz','27_3draw','badugi', '27_1draw']: hilo = "l" + #FIXME: recognise currency + #TODO: this wont work for non-standard structures tmp = self.insertGameTypes( (siteid, game['currency'], game['type'], game['base'], game['category'], game['limitType'], hilo, int(Decimal(game['sb'])*100), int(Decimal(game['bb'])*100), - int(Decimal(game['bb'])*100), int(Decimal(game['bb'])*200)) ) #TODO: this wont work for non-standard structures - #FIXME: recognise currency + int(Decimal(game['bb'])*100), int(Decimal(game['bb'])*200)), printdata = printdata) return tmp[0] - def insertGameTypes(self, row): + def insertGameTypes(self, row, printdata = False): + if printdata: + print _("######## Gametype ##########") + import pprint + pp = pprint.PrettyPrinter(indent=4) + pp.pprint(row) + print _("###### End Gametype ########") + c = self.get_cursor() c.execute( self.sql.query['insertGameTypes'], row ) return [self.get_last_insert_id(c)] diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 003f5270..8b1f4177 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -40,7 +40,6 @@ class DerivedStats(): self.handsplayers[player[1]]['winnings'] = 0 self.handsplayers[player[1]]['rake'] = 0 self.handsplayers[player[1]]['totalProfit'] = 0 - self.handsplayers[player[1]]['street4Seen'] = False self.handsplayers[player[1]]['street4Aggr'] = False self.handsplayers[player[1]]['wonWhenSeenStreet1'] = 0.0 self.handsplayers[player[1]]['sawShowdown'] = False @@ -58,6 +57,11 @@ class DerivedStats(): self.handsplayers[player[1]]['foldedSbToSteal'] = False self.handsplayers[player[1]]['foldedBbToSteal'] = False self.handsplayers[player[1]]['tourneyTypeId'] = None + self.handsplayers[player[1]]['street1Seen'] = False + self.handsplayers[player[1]]['street2Seen'] = False + self.handsplayers[player[1]]['street3Seen'] = False + self.handsplayers[player[1]]['street4Seen'] = False + for i in range(5): self.handsplayers[player[1]]['street%dCalls' % i] = 0 @@ -152,10 +156,11 @@ class DerivedStats(): else: self.handsplayers[player[1]]['tourneysPlayersIds'] = None + #### seen now processed in playersAtStreetX() # XXX: enumerate(list, start=x) is python 2.6 syntax; 'start' #for i, street in enumerate(hand.actionStreets[2:], start=1): - for i, street in enumerate(hand.actionStreets[2:]): - self.seen(self.hand, i+1) + #for i, street in enumerate(hand.actionStreets[2:]): + # self.seen(self.hand, i+1) for i, street in enumerate(hand.actionStreets[1:]): self.aggr(self.hand, i) @@ -298,6 +303,7 @@ class DerivedStats(): # FIXME?? - This isn't couting people that are all in - at least showdown needs to reflect this # ... new code below hopefully fixes this + # partly fixed, allins are now set as seeing streets because they never do a fold action self.hands['playersAtStreet1'] = 0 self.hands['playersAtStreet2'] = 0 @@ -324,18 +330,58 @@ class DerivedStats(): # actionStreets[1] is 'DEAL', 'THIRD', 'PREFLOP', so any player dealt cards # must act on this street if dealt cards. Almost certainly broken for the 'all-in blind' case # and right now i don't care - CG + p_in = set([x[0] for x in hand.actions[hand.actionStreets[1]]]) + # + # discover who folded on each street and remove them from p_in + # + # i values as follows 0=BLINDSANTES 1=PREFLOP 2=FLOP 3=TURN 4=RIVER + # (for flop games) + # + # At the beginning of the loop p_in contains the players with cards + # at the start of that street. + # p_in is reduced each street to become a list of players still-in + # e.g. when i=1 (preflop) all players who folded during preflop + # are found by pfba() and eliminated from p_in. + # Therefore at the end of the loop, p_in contains players remaining + # at the end of the action on that street, and can therefore be set + # as the value for the number of players who saw the next street + # + # note that i is 1 in advance of the actual street numbers in the db + # + # if p_in reduces to 1 player, we must bomb-out immediately + # because the hand is over, this will ensure playersAtStreetx + # is accurate. + # + for (i, street) in enumerate(hand.actionStreets): + if (i-1) in (1,2,3,4): + # p_in stores players with cards at start of this street, + # so can set streetxSeen & playersAtStreetx with this information + # This hard-coded for i-1 =1,2,3,4 because those are the only columns + # in the db! this code section also replaces seen() - more info log 66 + # nb i=2=flop=street1Seen, hence i-1 term needed + self.hands['playersAtStreet%d' % (i-1)] = len(p_in) + for player_with_cards in p_in: + self.handsplayers[player_with_cards]['street%sSeen' % (i-1)] = True + # + # find out who folded, and eliminate them from p_in + # actions = hand.actions[street] p_in = p_in - self.pfba(actions, l=('folds',)) - self.hands['playersAtStreet%d' % (i-1)] = len(p_in) - - self.hands['playersAtShowdown'] = len(p_in) + # + # if everyone folded, we are done, so exit this method immediately + # + if len(p_in) == 1: return None - if self.hands['playersAtShowdown'] > 1: - for player in p_in: - self.handsplayers[player]['sawShowdown'] = True + # + # The remaining players in p_in reached showdown (including all-ins + # because they never did a "fold" action in pfba() above) + # + self.hands['playersAtShowdown'] = len(p_in) + for showdown_player in p_in: + self.handsplayers[showdown_player]['sawShowdown'] = True def streetXRaises(self, hand): # self.actions[street] is a list of all actions in a tuple, contining the action as the second element @@ -447,17 +493,6 @@ class DerivedStats(): self.handsplayers[pname]['street%dCheckCallRaiseChance' % (i+1)] = True self.handsplayers[pname]['street%dCheckCallRaiseDone' % (i+1)] = act!='folds' - def seen(self, hand, i): - pas = set() - for act in hand.actions[hand.actionStreets[i+1]]: - pas.add(act[0]) - - for player in hand.players: - if player[1] in pas: - self.handsplayers[player[1]]['street%sSeen' % i] = True - else: - self.handsplayers[player[1]]['street%sSeen' % i] = False - def aggr(self, hand, i): aggrers = set() others = set() diff --git a/pyfpdb/FullTiltPokerSummary.py b/pyfpdb/FullTiltPokerSummary.py index 6ad7560e..79f50f01 100644 --- a/pyfpdb/FullTiltPokerSummary.py +++ b/pyfpdb/FullTiltPokerSummary.py @@ -46,7 +46,9 @@ class FullTiltPokerSummary(TourneySummary): substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes - 'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8) + 'LS' : "\$|\xe2\x82\xac|", # legal currency symbols - Euro(cp1252, utf-8) + 'TAB' : u"-\u2013'\s\da-zA-Z", # legal characters for tablename + 'NUM' : u".,\d", # legal characters in number format } re_SplitTourneys = re.compile("^Full Tilt Poker Tournament Summary") @@ -55,14 +57,21 @@ class FullTiltPokerSummary(TourneySummary): re_TourneyInfo = re.compile(u""" \s.* - (?PTournament|Sit\s\&\sGo)\s\((?P[0-9]+)\)(\s+)? + (?PTournament|Sit\s\&\sGo|\(Rebuy\)|)\s\((?P[0-9]+)\)(\s+)? (?PHold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s+ (?PNo\sLimit|Limit|LIMIT|Pot\sLimit)\s+ - (Buy-In:\s\$(?P[.\d]+)(\s\+\s\$(?P[.\d]+))?\s+)? + (Buy-In:\s[%(LS)s](?P[.\d]+)(\s\+\s[%(LS)s](?P[.\d]+))?\s+)? + (Add-On:\s[%(LS)s](?P[.\d]+)\s+)? + (Rebuy:\s[%(LS)s](?P[.\d]+)\s+)? + ((?P.{2,15})\sperformed\s(?P\d+)\sRebuys\s+)? (Buy-In\sChips:\s(?P\d+)\s+)? + (Add-On\sChips:\s(?P\d+)\s+)? + (Rebuy\sChips:\s(?P\d+)\s+)? (?P[0-9]+)\sEntries\s+ - (\$?(?P[.\d]+)\sadded\sto\sthe\sprize\spool\sby\sPokerStars\.com\s+)? - (Total\sPrize\sPool:\s\$?(?P[.0-9]+)\s+)? + (Total\sAdd-Ons:\s(?P\d+)\s+)? + (Total\sRebuys:\s(?P\d+)\s+)? + ([%(LS)s]?(?P[.\d]+)\sadded\sto\sthe\sprize\spool\sby\sPokerStars\.com\s+)? + (Total\sPrize\sPool:\s[%(LS)s]?(?P[%(NUM)s]+)\s+)? (Target\sTournament\s.*)? Tournament\sstarted:\s (?P[\d]{4})\/(?P[\d]{2})\/(?P[\d]+)\s+(?P[\d]+):(?P[\d]+):(?P[\d]+)\s??(?P[A-Z]+)\s @@ -70,21 +79,21 @@ class FullTiltPokerSummary(TourneySummary): re_Currency = re.compile(u"""(?P[%(LS)s]|FPP)""" % substitutions) - re_Player = re.compile(u"""(?P[\d]+):\s(?P[^,\r\n]{2,15})(,(\s)?\$(?P[.\d]+))?""") + re_Player = re.compile(u"""(?P[\d]+):\s(?P[^,\r\n]{2,15})(,(\s)?[%(LS)s](?P[.\d]+))?""") re_DateTime = re.compile("\[(?P[0-9]{4})\/(?P[0-9]{2})\/(?P[0-9]{2})[\- ]+(?P[0-9]+):(?P[0-9]+):(?P[0-9]+)") codepage = ["utf-16", "cp1252", "utf-8"] def parseSummary(self): - m = self.re_TourneyInfo.search(self.summaryText) + m = self.re_TourneyInfo.search(self.summaryText[:2000]) if m == None: tmp = self.summaryText[0:200] log.error(_("parseSummary: Unable to recognise Tourney Info: '%s'") % tmp) log.error(_("parseSummary: Raising FpdbParseError")) raise FpdbParseError(_("Unable to recognise Tourney Info: '%s'") % tmp) - print "DEBUG: m.groupdict(): %s" % m.groupdict() + #print "DEBUG: m.groupdict(): %s" % m.groupdict() mg = m.groupdict() if 'TOURNO' in mg: self.tourNo = mg['TOURNO'] @@ -119,7 +128,7 @@ class FullTiltPokerSummary(TourneySummary): m = self.re_Player.finditer(self.summaryText) for a in m: mg = a.groupdict() - print "DEBUG: a.groupdict(): %s" % mg + #print "DEBUG: a.groupdict(): %s" % mg name = mg['NAME'] rank = mg['RANK'] winnings = 0 diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 487cb12d..348338ba 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -37,30 +37,54 @@ class Fulltilt(HandHistoryConverter): substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes 'LS' : u"\$|\u20AC|\xe2\x82\xac|", # legal currency symbols - Euro(cp1252, utf-8) - 'TAB' : u"-\u2013\s\da-zA-Z" + 'TAB' : u"-\u2013'\s\da-zA-Z", # legal characters for tablename + 'NUM' : u".,\d", # legal characters in number format } + Lim_Blinds = { '0.04': ('0.01', '0.02'), '0.10': ('0.02', '0.05'), '0.20': ('0.05', '0.10'), + '0.40': ('0.10', '0.20'), '0.50': ('0.10', '0.25'), + '1.00': ('0.25', '0.50'), '1': ('0.25', '0.50'), + '2.00': ('0.50', '1.00'), '2': ('0.50', '1.00'), + '4.00': ('1.00', '2.00'), '4': ('1.00', '2.00'), + '6.00': ('1.00', '3.00'), '6': ('1.00', '3.00'), + '8.00': ('2.00', '4.00'), '8': ('2.00', '4.00'), + '10.00': ('2.00', '5.00'), '10': ('2.00', '5.00'), + '20.00': ('5.00', '10.00'), '20': ('5.00', '10.00'), + '30.00': ('10.00', '15.00'), '30': ('10.00', '15.00'), + '40.00': ('10.00', '20.00'), '40': ('10.00', '20.00'), + '60.00': ('15.00', '30.00'), '60': ('15.00', '30.00'), + '80.00': ('20.00', '40.00'), '80': ('20.00', '40.00'), + '100.00': ('25.00', '50.00'), '100': ('25.00', '50.00'), + '200.00': ('50.00', '100.00'), '200': ('50.00', '100.00'), + '300.00': ('75.00', '150.00'), '300': ('75.00', '150.00'), + '400.00': ('100.00', '200.00'), '400': ('100.00', '200.00'), + '500.00': ('125.00', '250.00'), '500': ('125.00', '250.00'), + '800.00': ('200.00', '400.00'), '800': ('200.00', '400.00'), + '1000.00': ('250.00', '500.00'),'1000': ('250.00', '500.00') + } + # Static regexes re_GameInfo = re.compile(u'''.*\#(?P[0-9]+):\s (?:(?P.+)\s\((?P\d+)\),\s)? .+ -\s(?P[%(LS)s]|)? - (?P[.0-9]+)/ - [%(LS)s]?(?P[.0-9]+)\s - (Ante\s\$?(?P[.0-9]+)\s)?-\s - [%(LS)s]?(?P[.0-9]+\sCap\s)? + (?P[%(NUM)s]+)/ + [%(LS)s]?(?P[%(NUM)s]+)\s + (Ante\s\$?(?P[%(NUM)s]+)\s)?-\s + [%(LS)s]?(?P[%(NUM)s]+\sCap\s)? (?P(No\sLimit|Pot\sLimit|Limit))?\s (?P(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi|2-7\sTriple\sDraw|5\sCard\sDraw|Badugi)) ''' % substitutions, re.VERBOSE) re_SplitHands = re.compile(r"\n\n\n+") re_TailSplitHands = re.compile(r"(\n\n+)") - re_HandInfo = re.compile(r'''.*\#(?P[0-9]+):\s + re_HandInfo = re.compile(u'''.*\#(?P[0-9]+):\s (?:(?P.+)\s\((?P\d+)\),\s)? - (Table|Match)\s + ((Table|Match)\s)? (?PPlay\sChip\s|PC)? - (?P[%(TAB)s]+)\s + ((?P
[%(TAB)s]+)(\s|,)) + (?P\sEntry\s\#\d+\s)? (\((?P.+)\)\s)?-\s - [%(LS)s]?(?P[.0-9]+)/[%(LS)s]?(?P[.0-9]+)\s(Ante\s[%(LS)s]?(?P[.0-9]+)\s)?-\s + [%(LS)s]?(?P[%(NUM)s]+)/[%(LS)s]?(?P[%(NUM)s]+)\s(Ante\s[%(LS)s]?(?P[.0-9]+)\s)?-\s [%(LS)s]?(?P[.0-9]+\sCap\s)? (?P[-\da-zA-Z\/\'\s]+)\s-\s (?P.*$) @@ -75,8 +99,8 @@ class Fulltilt(HandHistoryConverter): (\s\((?PTurbo)\))?)|(?P.+)) ''' % substitutions, re.VERBOSE) re_Button = re.compile('^The button is in seat #(?P
[\'\w\s]+)\s\[\d+\]\s\( + Table:\s(?P
[-\'\w\s]+)\s\[\d+\]\s\( ( (?PNO_LIMIT|Limit|LIMIT|Pot\sLimit)\s (?PTEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ|FIVE_CARD_DRAW)\s - (%(LS)s)?(?P[.0-9]+)/ + (?P%(LS)s|)?(?P[.0-9]+)/ (%(LS)s)?(?P[.0-9]+) )? - """ % substitutions, re.MULTILINE|re.DOTALL|re.VERBOSE) + """ % substitutions, re.MULTILINE|re.DOTALL|re.VERBOSE) #TODO: detect play money (identified by "Play money" rather than "Real money" and set currency accordingly re_TailSplitHands = re.compile(u'(\*\*\*\*\*\sEnd\sof\shand\s[-A-Z\d]+.*\n)(?=\*)') re_Button = re.compile('Button: seat (?P