git24 - changed config file format to match new way of passing around settings inside the code - will use this to facilitate various code cleanups and a generalised method of dealing with settings

got deep links for windows DL for everything
tv option of combined postflop is now exported to profile
This commit is contained in:
steffen123 2008-08-11 00:44:46 +01:00
parent 488af76f8e
commit 9b737612d0
7 changed files with 56 additions and 63 deletions

View File

@ -11,6 +11,8 @@ FT=Turn Fold percentage
HD=Hands
PF3B4B=Pre Flop 3Bet or 4Bet
PFR=Pre Flop Raise
Postf A=Postflop (ie. flop+turn+river) Aggression%
Postf F=Postflop Fold %
SD/F=Showdown/Flop=WtSD=How often player went to showdown when he saw the flop
W$wsF=Won $ when he saw flop
W$@SD=Won $ at showdown

View File

@ -1,6 +1,6 @@
backend=2
host=localhost
database=fpdb
user=fpdb
password=enterYourPwHere
db-backend=2
db-host=localhost
db-databaseName=fpdb
db-user=fpdb
db-password=enterYourPwHere
tv-combinedPostflop=True

View File

@ -3,12 +3,17 @@ made them in XP Pro, if you discover any differences or problems please let me k
Also see the other install-in-*.txt files.
The length of these instructions is due to MS refusal to provide any kind of package management.
For some packages I've given direct(ish) download links here, for the remainder check requirements.txt.
Here are direct download links from 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 from http://dev.mysql.com/downloads/mysql/5.0.html#win32
Note that there is a link to skip registration/login.
As of this writing the latest binary version is 5.0.51b whilst the latest version is 5.0.56... Windows.
- 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 have reason not to.
@ -20,12 +25,11 @@ Once finished it shold confirm "service started successfully"
Then configure a user and create a database.
2. Install python
Go to http://www.python.org/download/ and 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.
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:
Go to http://sourceforge.net/project/showfiles.php?group_id=22307 and get the latest version of MySQL-python-*.win32-py2.5.exe
Double click to install.
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
@ -36,8 +40,7 @@ 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. (But you presumably already did that, as you are
reading this file.)
unzip this bundle.
Then add the bin folder to your PATH. Make sure you have no other
versions of GTK+ in PATH.

View File

@ -3,13 +3,12 @@ todolist (db=database, imp=importer, tv=tableviewer)
before alpha
============
fix default pathes up to sensible ones
get deep links for windows DL for everything
GUI license info
update regression testing to take into account everything new, make sure it passes all tests
3B/4B might not be recognised nor counted as chance if someone raised after player called.
add to install the sql commands to create DB etc.
next
====
3B/4B might not be recognised nor counted as chance if someone raised after player called.
fill steal fields correctly, add to tester and tv
CB, 2nd/3rd Barrel, fold to these
@ -21,7 +20,6 @@ why do we have to reconnect in tv.read_names_clicked?
implement error file in importer
catch index error, type error, file not found error
finish updating filelist
export combinedPostflop from table_viewer.prepareData to profile
use different colours according to classification.
table with data for graphs for SD/F, W$wSF, W$@SD

View File

@ -8,7 +8,6 @@ Before I start the list a note on the databases, as of git96 I have yet to try u
If you use a package management system (e.g. if you have GNU/Linux or *BSD) just check that you have mysql, mysql-python and pygtk or postgresql, pygresql and pygtk. Your package manager will take care of the rest for you.
Make new entries in this format:
X. Program Name
===============
@ -91,8 +90,8 @@ c. Project Webpage
d. License
LGPL2
7. PyGObject
============
7. PyCairo
==========
a. Optional?
Required.
b. Required Version and Why
@ -102,8 +101,8 @@ c. Project Webpage
d. License
LGPL2.1
8. PyCairo
==========
8. PyGObject
============
a. Optional?
Required.
b. Required Version and Why

View File

@ -241,43 +241,33 @@ class fpdb:
self.profile=filename
self.bulk_import_default_path="/work/poker-histories/wine-ps/" #/todo: move this to .conf
found_backend, found_host, found_database, found_user, found_password=False, False, False, False, False
self.settings={'db-host':"localhost", 'db-backend':2, 'db-databaseName':"fpdb", 'db-user':"fpdb"}
if (os.sep=="/"):
self.settings['os']="linuxmac"
else:
self.settings['os']="windows"
for i in range(len(lines)):
if lines[i].startswith("backend="):
backend=int(lines[i][8:-1])
found_backend=True
elif lines[i].startswith("host="):
host=lines[i][5:-1]
#self.host=host
found_host=True
elif lines[i].startswith("database="):
database=lines[i][9:-1]
#self.database=database
found_database=True
elif lines[i].startswith("user="):
user=lines[i][5:-1]
found_user=True
elif lines[i].startswith("password="):
password=lines[i][9:-1]
found_password=True
if not found_backend:
raise fpdb_simple.FpdbError("failed to read backend from settings file:"+filename)
elif not found_host:
raise fpdb_simple.FpdbError("failed to read host from settings file:"+filename)
elif not found_database:
raise fpdb_simple.FpdbError("failed to read database from settings file:"+filename)
elif not found_user:
raise fpdb_simple.FpdbError("failed to read user from settings file:"+filename)
elif not found_password:
raise fpdb_simple.FpdbError("failed to read password from settings file:"+filename)
if lines[i].startswith("db-backend="):
self.settings['db-backend']=int(lines[i][11:-1])
elif lines[i].startswith("db-host="):
self.settings['db-host']=lines[i][8:-1]
elif lines[i].startswith("db-databaseName="):
self.settings['db-database']=lines[i][16:-1]
elif lines[i].startswith("db-user="):
self.settings['db-user']=lines[i][8:-1]
elif lines[i].startswith("db-password="):
self.settings['db-password']=lines[i][12:-1]
elif lines[i].startswith("tv-combinedPostflop="):
if lines[i].find("True")!=-1:
self.settings['tv-combinedPostflop']=True
else:
self.settings['tv-combinedPostflop']=False
if self.db!=None:
self.db.disconnect()
self.db = fpdb_db.fpdb_db()
self.db.connect(backend, host, database, user, password)
self.db.connect(self.settings['db-backend'], self.settings['db-host'], self.settings['db-databaseName'], self.settings['db-user'], self.settings['db-password'])
#end def load_profile
def not_implemented(self):
@ -320,15 +310,16 @@ class fpdb:
"""Displays a tab with the main fpdb help screen"""
#print "start of tab_main_help"
mh_tab=gtk.Label("""Welcome to Fpdb!
For howto information please see docs/readme-user.txt
This program is licensed under the AGPL3, see docs/agpl-3.0.txt""")
For howto information please see docs"""+os.sep+"""readme-user.txt
The abbrevations in the table viewer are explained in docs"""+os.sep+"""abbrevations.txt
This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
self.add_and_display_tab(mh_tab, "main help")
#end def tab_main_help
def tab_table_viewer(self, widget, data):
"""opens a table viewer tab"""
#print "start of tab_table_viewer"
new_tv_thread=table_viewer.table_viewer(self.db)
new_tv_thread=table_viewer.table_viewer(self.db, self.settings)
self.threads.append(new_tv_thread)
tv_tab=new_tv_thread.get_vbox()
self.add_and_display_tab(tv_tab, "table viewer")

View File

@ -57,12 +57,11 @@ class table_viewer (threading.Thread):
"""prepares the data for display by refresh_clicked, returns a 2D array"""
#print "start of prepare_data"
arr=[]
combinedPostflop=True #todo: export as option
#first prepare the header row
if (self.category=="holdem" or self.category=="omahahi" or self.category=="omahahilo"):
tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "AF", "FF", "AT", "FT", "AR", "FR", "SD/F", "W$wsF", "W$@SD")
if (combinedPostflop):
tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "F-R Aggr", "F-R Fold", "SD/F", "W$wsF", "W$@SD")
if self.settings['tv-combinedPostflop']:
tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "Postf A", "Postf F", "SD/F", "W$wsF", "W$@SD")
else:
raise fpdb_simple.FpdbError("reimplement stud")
tmp=("Name", "Hands", "VPI3", "A3", "3B4B_3" "A4", "F4", "A5", "F5", "A6", "F6", "A7", "F7", "SD/4")
@ -108,7 +107,7 @@ class table_viewer (threading.Thread):
tmp.append(self.hudDivide(row[5],row[4])) #VPIP
tmp.append(self.hudDivide(row[6],row[4])) #PFR
tmp.append(self.hudDivide(row[8],row[7])+" ("+str(row[7])+")") #PF3B4B
if (combinedPostflop):
if self.settings['tv-combinedPostflop']:
aggCount=row[13]+row[14]+row[15]
handCount=row[9]+row[10]+row[11]
foldCount=row[17]+row[19]+row[21]
@ -222,12 +221,13 @@ class table_viewer (threading.Thread):
return self.main_vbox
#end def get_vbox
def __init__(self, db, debug=True):
def __init__(self, db, settings, debug=True):
"""Constructor for table_viewer"""
self.debug=debug
#print "start of table_viewer constructor"
self.db=db
self.cursor=db.cursor
self.settings=settings
self.main_vbox = gtk.VBox(False, 0)
self.main_vbox.show()