Open Side Menu Go to the Top
Register
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013

08-07-2009 , 02:13 AM
what program did you use to create it? i need to know to open it
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-07-2009 , 02:30 AM
never mind about my last post and i think i did it twice by accident i downloaded the right one now thanks
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-07-2009 , 09:27 AM
Quote:
Originally Posted by jefkve
...
HUD_main starting
Using db name = fpdb
site = PokerStars, max = 6, fav seat = 4
found fav seat = 4
Error finding actual seat.
exception in adj!!!

...
This is new. Somehow the HUD doesn't know what seat you are in. I would like to see the first 2 HHs out of that file.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 10:05 AM
Well, here's some good news, if anyone cares (which around here, I bet they don't) ..

Absolute Poker NL Hold'em is at least functioning, and it seems to be working on both regular tables and 7-2 tables (although there is no special handling of the 7-2 game, and i haven't actually seen anyone hit the 7-2 pot so i have no idea if / what it stores about it) . The downside is that it'll probably be a long time before I bother to get it working with the rest of the games. Another downside is that the HUD randomly attaches to the Chat window instead of the Table window .. and we can't fix that without adding more stuff. So, although it works (and I was able to convert one of the existing handhistory parsers to work with this in about 2 hrs, with some extra bug fixing by s0rrow) it's accuracy has not (yet) been verified, and although AP plays a whole complement of games, as well as mixed games, it won't be supporting anything beyond holdem for a while.

But, then, no one on 2+2 plays on AP, anyway, right ?
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 10:46 AM
Somebody knows as to reduce hud and to clean a symbol % ?
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 01:14 PM
Quote:
Originally Posted by ekdikeo
Well, here's some good news, if anyone cares (which around here, I bet they don't) ..

Absolute Poker NL Hold'em is at least functioning, and it seems to be working on both regular tables and 7-2 tables (although there is no special handling of the 7-2 game, and i haven't actually seen anyone hit the 7-2 pot so i have no idea if / what it stores about it) . The downside is that it'll probably be a long time before I bother to get it working with the rest of the games. Another downside is that the HUD randomly attaches to the Chat window instead of the Table window .. and we can't fix that without adding more stuff. So, although it works (and I was able to convert one of the existing handhistory parsers to work with this in about 2 hrs, with some extra bug fixing by s0rrow) it's accuracy has not (yet) been verified, and although AP plays a whole complement of games, as well as mixed games, it won't be supporting anything beyond holdem for a while.

But, then, no one on 2+2 plays on AP, anyway, right ?
AP support is not available in the released version yet. Party and BossMedia importers have also been contributed (thanks!) and are available in the git repos. I think they just work for holdem, and they are not well tested.

Pretty impressive that ekdikeo could implement a new site in 2 hours with just a little help from s0rrow. So adding a new site is pretty easy for anybody who is interested in giving it a try. (you need regular expressions skills + some rudimentary python knowledge) We (the devs) are probably not going to spend much time implementing sites we don't play. That is why we have they plugin thingie to support new sites.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 03:46 PM
Just wondering... when I play hi/lo stud, the python hand replayer pops up and I have to close it down. But , when I play Omaha hi/lo the replayer doesn't open by default (my preference). Why the difference?

Dog
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 04:19 PM
Quote:
Originally Posted by 1meandog4u
Just wondering... when I play hi/lo stud, the python hand replayer pops up and I have to close it down. But , when I play Omaha hi/lo the replayer doesn't open by default (my preference). Why the difference?

Dog
By replayer, I think you mean the mucked cards display (for stud). In the HUD_config file you have specified the stud_mucked aux_window like this:
Quote:
<game aux="stud_mucked" cols="3" db="fpdb" game_name="studhilo" rows="2">
Just delete that and you don't get the stud_mucked window. The stud_mucked aux doesn't work for flop games (use mucked for flop games).

I wrote the stud_mucked window to always display itself when activated (it can be minimized) because I play a max of 3 stud games at once and I compulsively look at my opponents' hole cards.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 04:29 PM
Quote:
Originally Posted by ColdRock
Somebody knows as to reduce hud and to clean a symbol % ?
There is no easy way to change this in the released version. That will change in future releases. It will take you about 2 min to change the code.

For example to get rid of the % on the vpip stat, change this:
Quote:
def vpip(stat_dict, player):
""" Voluntarily put $ in the pot."""
stat = 0.0
try:
stat = float(stat_dict[player]['vpip'])/float(stat_dict[player]['n'])
return (stat,
'%3.1f' % (100*stat) + '%',
'v=%3.1f' % (100*stat) + '%',
'vpip=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['vpip'], stat_dict[player]['n']),
'Voluntarily Put In Pot %'
)
except: ...
to this:
Quote:
def vpip(stat_dict, player):
""" Voluntarily put $ in the pot."""
stat = 0.0
try:
stat = float(stat_dict[player]['vpip'])/float(stat_dict[player]['n'])
return (stat,
'%3.1f' % (100*stat)',
'v=%3.1f' % (100*stat) + '%',
'vpip=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['vpip'], stat_dict[player]['n']),
'Voluntarily Put In Pot %'
)
except: ...
in the Stats.py file in your pyfpdb folder.

Just do that for each of the stats you use. It would be a good idea to save a copy of the original file before you start editing.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 09:50 PM
Quote:
Originally Posted by Eratosthenes
There is no easy way to change this in the released version. That will change in future releases. It will take you about 2 min to change the code.

For example to get rid of the % on the vpip stat, change this:
to this:
in the Stats.py file in your pyfpdb folder.

Just do that for each of the stats you use. It would be a good idea to save a copy of the original file before you start editing.
I made the changes to several stats. Then saved the file. Closed the PythonWin. Opened fpdb just fine and the python command window. I clicked on autoimport. I noticed the HUD window did not open and when I sat in a game it DID import the stats, but the HUD never opened.

I've included a "strange" screen shot I took when I reopened the file. Every line I had made a change on seemed to have the green line, seemingly warning me of an error. I even checked for any blank spaces, I thought I did it correctly. Can you see anything I did wrong? Was I also supposed to change the part below the "except"?

Dog

Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-08-2009 , 10:17 PM
Quote:
Originally Posted by 1meandog4u
I made the changes to several stats. Then saved the file. ...
I screwed up in my previous post--hard to believe, but true. Get rid of the single quote that I left in by mistake. I made it red in the quote below.
Quote:
return (stat,
'%3.1f' % (100*stat)',
'v=%3.1f' % (100*stat) + '%',
You'll have to fix it in every function.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-09-2009 , 08:09 AM
Hey guys,

is there a user guide on how to create fpdb database on Postgres and set permissions?
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-09-2009 , 02:20 PM
Quote:
Originally Posted by donkequity
Hey guys,

is there a user guide on how to create fpdb database on Postgres and set permissions?
I can't figure that out either. It needs a host? What about "SSL," should I leave that blank? How about DB restriction and service?

Also, when I double click "fpdb.py" a black coding box pops up for ~a quarter of a second then auto-closes and nothing happens. I'm guessing that's because it's not connected to a database but idk
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-09-2009 , 06:11 PM
Quote:
Originally Posted by Eratosthenes
You'll have to fix it in every function.
I did that, and it worked perfect. Is there a way to shorten the size of the columns. I looked in the config, not there. I thought the HUD stats box would shrink with the elimination of the "%" sign... it didn't.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-09-2009 , 06:34 PM
Quote:
Originally Posted by dorado29
I can't figure that out either. It needs a host? What about "SSL," should I leave that blank? How about DB restriction and service?

Also, when I double click "fpdb.py" a black coding box pops up for ~a quarter of a second then auto-closes and nothing happens. I'm guessing that's because it's not connected to a database but idk
Hi guys--

I am slightly embarrassed to say that I cannot reliably set up PostgreSQL. I got it set up once, but when I went to walk back through it, I could not repeat it.

Here is the how to set up mysql that I wrote, it should supply some clues. You just have to translate to postgres.

You should not need SSL.

Take notes! Send me the notes and I'll post them on the wiki.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-09-2009 , 06:41 PM
Quote:
Originally Posted by 1meandog4u
I did that, and it worked perfect. Is there a way to shorten the size of the columns. I looked in the config, not there. I thought the HUD stats box would shrink with the elimination of the "%" sign... it didn't.
To lower the precision of the stat, change this:
Quote:
'%3.1f' % (100*stat),
to this:
Quote:
'%2.0f' % (100*stat),
This stuff is adjustable in the next release via config file (That makes it easy!)

The stat window should be smaller after you get rid of the % symbol. The stats are in a grid so a stat won't be narrower than the one below/above it.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-09-2009 , 11:33 PM
there seem to be a bunch of slightly different sets of instructions

maybe it's just me
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 12:17 AM
Meh I kind of got it. I followed the tutorial here (using MySQL) http://****************/apps/mediawik...all_in_Windows. I didn't download PyLab because I can't find it for download anywhere. I went into fpdb_0.11.3 and double clicked on the fpdb.py icon and a black coding box popped up for a fraction of a second then disappeared before I could read it.

I'm running Vist 64bit so i looked in the random vista tips part of the wiki:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, in addition to these files, you'll need to also get ..
FPDB, GTK, MySQL (or PGSQL, if/when that works fully)

http://redir.zombiebytes.com/fpdbstuff.zip

I think the order of installation should go something like:

python-2.6.1.msi
MySQL-python-1.2.2 ...
pywin32-213.win32-py2.6.exe
pygtk-2.12.1-3-win32...
pycairo-1.4.12-2.win32-...
pygobject-2.14.2-2.win32...
numpy-1.3.0-win32-superpack...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This results in my having Python 2.5 and 2.6 on my computer. Is this standard? It seems a tad redundant
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 09:09 AM
Quote:
Originally Posted by dorado29
Meh I kind of got it. I followed the tutorial here (using MySQL) http://****************/apps/mediawik...all_in_Windows. I didn't download PyLab because I can't find it for download anywhere. I went into fpdb_0.11.3 and double clicked on the fpdb.py icon and a black coding box popped up for a fraction of a second then disappeared before I could read it.

I'm running Vist 64bit so i looked in the random vista tips part of the wiki:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, in addition to these files, you'll need to also get ..
FPDB, GTK, MySQL (or PGSQL, if/when that works fully)

http://redir.zombiebytes.com/fpdbstuff.zip

I think the order of installation should go something like:

python-2.6.1.msi
MySQL-python-1.2.2 ...
pywin32-213.win32-py2.6.exe
pygtk-2.12.1-3-win32...
pycairo-1.4.12-2.win32-...
pygobject-2.14.2-2.win32...
numpy-1.3.0-win32-superpack...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This results in my having Python 2.5 and 2.6 on my computer. Is this standard? It seems a tad redundant
fpdb needs either Python 2.5 or 2.6. (2.4 works, too) I think it works equally well with either.

When the command line window is quickly opening and closing (the black window you are briefly seeing), you probably have some simple problem in the config file or similar. Two things:
  • Look for file fpdb-error-log.txt in the folder where you started fpdb. (Or just use the search for files thingie.) It might have some helpful info.
  • Try starting fpdb from the command line so we can see any error info that we miss when the window immediately closes. Open a command line in the start menu, navigate to the folder where fpdb.py is stored and they type this:
    Code:
    python fpdb.py -x
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 01:12 PM
haha i ended up just clicking the fpdb icon a ton of times and getting a few letters of the message at a time. It said that the info was located in fpdb-error-log.txt


Code:
Traceback (most recent call last):
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb.py", line 465, in <module>
    me = fpdb()
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb.py", line 377, in __init__
    self.load_profile()
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb.py", line 269, in load_profile
    self.settings['db-password'])
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb_db.py", line 62, in connect
    self.db=MySQLdb.connect(host = host, user = user, passwd = password, db = database, use_unicode=True)
  File "C:\Python25\lib\site-packages\MySQLdb\__init__.py", line 74, in Connect
    return Connection(*args, **kwargs)
  File "C:\Python25\lib\site-packages\MySQLdb\connections.py", line 170, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'fpdb'@'localhost' (using password: YES)")
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 02:16 PM
Quote:
Originally Posted by dorado29
haha i ended up just clicking the fpdb icon a ton of times and getting a few letters of the message at a time. It said that the info was located in fpdb-error-log.txt


Code:
Traceback (most recent call last):
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb.py", line 465, in <module>
    me = fpdb()
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb.py", line 377, in __init__
    self.load_profile()
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb.py", line 269, in load_profile
    self.settings['db-password'])
  File "C:\Users\Ross\Desktop\Desktop\fpdb_0.11.3\pyfpdb\fpdb_db.py", line 62, in connect
    self.db=MySQLdb.connect(host = host, user = user, passwd = password, db = database, use_unicode=True)
  File "C:\Python25\lib\site-packages\MySQLdb\__init__.py", line 74, in Connect
    return Connection(*args, **kwargs)
  File "C:\Python25\lib\site-packages\MySQLdb\connections.py", line 170, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'fpdb'@'localhost' (using password: YES)")
That error message indicates that you are using MySQL, but have supplied either a wrong username or wrong password. It looks like MySQL is running. The mysql howto is here (the wiki seems slow and/or unreliable recently--you may have to click on the link a couple of times). Step 1 in that how to tells you how to log in from the command line--you can test username/password that way.

The database line in you config should look like this:
Quote:
<supported_databases>
<database db_ip="localhost" db_name="fpdb" db_pass="YOUR_Password" db_server="mysql" db_type="fpdb" db_user="fpdb"> </database>
</supported_databases>
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 06:31 PM
nice alright I made a fpdb database in MySQL. I went into HUD_config.xml and put my password into the proper spot (lol it took forever to find the spot because its in notepad and scrolls sideways for like evarrr)

Anywho, now what do I do? When I double click the fpdb icon it opens up a white code box:

Code:
#!/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 os
import sys
from optparse import OptionParser


parser = OptionParser()
parser.add_option("-x", "--errorsToConsole", action="store_true",
                help="If passed error output will go to the console rather than .")
parser.add_option("-d", "--databaseName", dest="dbname", default="fpdb",
                help="Overrides the default database name")
(options, sys.argv) = parser.parse_args()

if not options.errorsToConsole:
    print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
    errorFile = open('fpdb-error-log.txt', 'w', 0)
    sys.stderr = errorFile

import pygtk
pygtk.require('2.0')
import gtk

import fpdb_db
import fpdb_simple
import GuiBulkImport
import GuiPlayerStats
import GuiPositionalStats
import GuiTableViewer
import GuiAutoImport
import GuiGraphViewer
import FpdbSQLQueries
import Configuration

VERSION = "0.11.3"

class fpdb:
    def tab_clicked(self, widget, tab_name):
        """called when a tab button is clicked to activate that tab"""
        #print "start of tab_clicked"
        self.display_tab(tab_name)
    #end def tab_clicked

    def add_and_display_tab(self, new_tab, new_tab_name):
        """just calls the component methods"""
        self.add_tab(new_tab, new_tab_name)
        self.display_tab(new_tab_name)
    #end def add_and_display_tab

    def add_tab(self, new_tab, new_tab_name):
        """adds a tab, namely creates the button and displays it and appends all the relevant arrays"""
        #print "start of add_tab"
        for i in self.tab_names: #todo: check this is valid
            if i==new_tab_name:
                return # we depend on this to not create duplicate tabs, there's no reason to raise an error here?
#                raise fpdb_simple.FpdbError("duplicate tab_name not permitted")

        self.tabs.append(new_tab)
        self.tab_names.append(new_tab_name)

        new_tab_sel_button=gtk.ToggleButton(new_tab_name)
        new_tab_sel_button.connect("clicked", self.tab_clicked, new_tab_name)
        self.tab_box.add(new_tab_sel_button)
        new_tab_sel_button.show()
        self.tab_buttons.append(new_tab_sel_button)
    #end def add_tab

    def display_tab(self, new_tab_name):
        """displays the indicated tab"""
        #print "start of display_tab, len(self.tab_names):",len(self.tab_names)
        tab_no = -1
        for i, name in enumerate(self.tab_names):
            if name == new_tab_name:
                tab_no = i
                break

        if tab_no == -1:
            raise fpdb_simple.FpdbError("invalid tab_no")
        else:
            self.main_vbox.remove(self.current_tab)
            #self.current_tab.destroy()
            self.current_tab=self.tabs[tab_no]
            self.main_vbox.add(self.current_tab)
            self.tab_buttons[tab_no].set_active(True)
            self.current_tab.show()
    #end def display_tab

    def delete_event(self, widget, event, data=None):
        return False
    #end def delete_event

    def destroy(self, widget, data=None):
        self.quit(widget, data)
    #end def destroy

    def dia_about(self, widget, data):
        print "todo: implement dia_about",
        print " version = %s, requires database version %s" % (VERSION, "118")
    #end def dia_about

    def dia_create_del_database(self, widget, data):
        print "todo: implement dia_create_del_database"
        self.obtain_global_lock()
    #end def dia_create_del_database

    def dia_create_del_user(self, widget, data):
        print "todo: implement dia_create_del_user"
        self.obtain_global_lock()
    #end def dia_create_del_user

    def dia_database_stats(self, widget, data):
        print "todo: implement dia_database_stats"
        #string=fpdb_db.getDbStats(db, cursor)
    #end def dia_database_stats

    def dia_delete_db_parts(self, widget, data):
        print "todo: implement dia_delete_db_parts"
        self.obtain_global_lock()
    #end def dia_delete_db_parts

    def dia_edit_profile(self, widget=None, data=None, create_default=False, path=None):
        print "todo: implement dia_edit_profile"
        self.obtain_global_lock()
    #end def dia_edit_profile

    def dia_export_db(self, widget, data):
        print "todo: implement dia_export_db"
        self.obtain_global_lock()
    #end def dia_export_db

    def dia_get_db_root_credentials(self):
        """obtains db root credentials from user"""
        print "todo: implement dia_get_db_root_credentials"
#        user, pw=None, None
#        
#        dialog=gtk.Dialog(title="DB Credentials needed", parent=None, flags=0,
#                buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,"Connect and recreate",gtk.RESPONSE_OK))
#        
#        label_warning1=gtk.Label("Please enter credentials for a database user for "+self.host+" that has permissions to create a database.")
#        
#        
#        label_user=gtk.Label("Username")
#        dialog.vbox.add(label_user)
#        label_user.show()
#        
#        response=dialog.run()
#        dialog.destroy()
#        return (user, pw, response)
    #end def dia_get_db_root_credentials

    def dia_import_db(self, widget, data):
        print "todo: implement dia_import_db"
        self.obtain_global_lock()
    #end def dia_import_db

    def dia_licensing(self, widget, data):
        print "todo: implement dia_licensing"
    #end def dia_licensing

    def dia_load_profile(self, widget, data):
        """Dialogue to select a file to load a profile from"""
        self.obtain_global_lock()
        chooser = gtk.FileChooserDialog(title="Please select a profile file to load",
                action=gtk.FILE_CHOOSER_ACTION_OPEN,
                buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
        chooser.set_filename(self.profile)

        response = chooser.run()
        chooser.destroy()    
        if response == gtk.RESPONSE_OK:
            self.load_profile(chooser.get_filename())
        elif response == gtk.RESPONSE_CANCEL:
            print 'User cancelled loading profile'
    #end def dia_load_profile

    def dia_recreate_tables(self, widget, data):
        """Dialogue that asks user to confirm that he wants to delete and recreate the tables"""
        self.obtain_global_lock()
        
        dia_confirm = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING,
                buttons=(gtk.BUTTONS_YES_NO), message_format="Confirm deleting and recreating tables")
        diastring = "Please confirm that you want to (re-)create the tables. If there already are tables in the database "+self.db.database+" on "+self.db.host+" they will be deleted."
        dia_confirm.format_secondary_text(diastring)#todo: make above string with bold for db, host and deleted

        response = dia_confirm.run()
        dia_confirm.destroy()
        if response == gtk.RESPONSE_YES:
            self.db.recreate_tables()
        elif response == gtk.RESPONSE_NO:
            print 'User cancelled recreating tables'
    #end def dia_recreate_tables

    def dia_regression_test(self, widget, data):
        print "todo: implement dia_regression_test"
        self.obtain_global_lock()
    #end def dia_regression_test

    def dia_save_profile(self, widget, data):
        print "todo: implement dia_save_profile"
    #end def dia_save_profile

    def diaSetupWizard(self, path):
        print "todo: implement setup wizard"
        print "setup wizard not implemented - please create the default configuration file:", path    
        diaSetupWizard = gtk.Dialog(title="Fatal Error - Config File Missing", parent=None, flags=0, buttons=(gtk.STOCK_QUIT,gtk.RESPONSE_OK))

        label = gtk.Label("Please copy the config file from the docs folder to:")
        diaSetupWizard.vbox.add(label)
        label.show()

        label = gtk.Label(path)
        diaSetupWizard.vbox.add(label)
        label.show()

        label = gtk.Label("and edit it according to the install documentation at http://fpdb.****************")
        diaSetupWizard.vbox.add(label)
        label.show()

        response = diaSetupWizard.run()
        sys.exit(1)
    #end def diaSetupWizard

    def get_menu(self, window):
        """returns the menu for this program"""
        accel_group = gtk.AccelGroup()
        self.item_factory = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group)
        self.item_factory.create_items(self.menu_items)
        window.add_accel_group(accel_group)
        return self.item_factory.get_widget("<main>")
    #end def get_menu

    def load_profile(self):
        """Loads profile from the provided path name."""
        self.settings = {}
        if (os.sep=="/"):
            self.settings['os']="linuxmac"
        else:
            self.settings['os']="windows"

        self.settings.update(self.config.get_db_parameters())
        self.settings.update(self.config.get_tv_parameters())
        self.settings.update(self.config.get_import_parameters())
        self.settings.update(self.config.get_default_paths())

        if self.db!=None:
            self.db.disconnect()

        self.db = fpdb_db.fpdb_db()
        #print "end of fpdb.load_profile, databaseName:",self.settings['db-databaseName']
        self.db.connect(self.settings['db-backend'],
            self.settings['db-host'],
            self.settings['db-databaseName'],
            self.settings['db-user'], 
            self.settings['db-password'])
        if self.db.wrongDbVersion:
            diaDbVersionWarning = gtk.Dialog(title="Strong Warning - Invalid database version", parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK))

            label = gtk.Label("An invalid DB version or missing tables have been detected.")
            diaDbVersionWarning.vbox.add(label)
            label.show()

            label = gtk.Label("This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu.")
            diaDbVersionWarning.vbox.add(label)
            label.show()

            label = gtk.Label("Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc.")
            diaDbVersionWarning.vbox.add(label)
            label.show()

            response = diaDbVersionWarning.run()
            diaDbVersionWarning.destroy()

        # Database connected to successfully, load queries to pass on to other classes
        self.querydict = FpdbSQLQueries.FpdbSQLQueries(self.db.get_backend_name())
    #end def load_profile

    def not_implemented(self):
        print "todo: called unimplemented menu entry (users: pls ignore this)"#remove this once more entries are implemented
    #end def not_implemented

    def obtain_global_lock(self):
        print "todo: implement obtain_global_lock (users: pls ignore this)"
    #end def obtain_global_lock

    def quit(self, widget, data):
        print "Quitting normally"
        #check if current settings differ from profile, if so offer to save or abort
        self.db.disconnect()
        gtk.main_quit()
    #end def quit_cliecked

    def release_global_lock(self):
        print "todo: implement release_global_lock"
    #end def release_global_lock

    def tab_abbreviations(self, widget, data):
        print "todo: implement tab_abbreviations"
    #end def tab_abbreviations

    def tab_auto_import(self, widget, data):
        """opens the auto import tab"""
        new_aimp_thread=GuiAutoImport.GuiAutoImport(self.settings, self.config)
        self.threads.append(new_aimp_thread)
        aimp_tab=new_aimp_thread.get_vbox()
        self.add_and_display_tab(aimp_tab, "Auto Import")
    #end def tab_auto_import

    def tab_bulk_import(self, widget, data):
        """opens a tab for bulk importing"""
        #print "start of tab_bulk_import"
        new_import_thread=GuiBulkImport.GuiBulkImport(self.db, self.settings, self.config)
        self.threads.append(new_import_thread)
        bulk_tab=new_import_thread.get_vbox()
        self.add_and_display_tab(bulk_tab, "Bulk Import")
    #end def tab_bulk_import

    def tab_player_stats(self, widget, data):
        new_ps_thread=GuiPlayerStats.GuiPlayerStats(self.db, self.config, self.querydict)
        self.threads.append(new_ps_thread)
        ps_tab=new_ps_thread.get_vbox()
        self.add_and_display_tab(ps_tab, "Player Stats")

    def tab_positional_stats(self, widget, data):
        new_ps_thread=GuiPositionalStats.GuiPositionalStats(self.db, self.config, self.querydict)
        self.threads.append(new_ps_thread)
        ps_tab=new_ps_thread.get_vbox()
        self.add_and_display_tab(ps_tab, "Positional Stats")


    def tab_main_help(self, widget, data):
        """Displays a tab with the main fpdb help screen"""
        #print "start of tab_main_help"
        mh_tab=gtk.Label("""Welcome to Fpdb!
For documentation please visit our website at http://fpdb.****************/ or check the docs directory in the fpdb folder.
Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml
This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
        self.add_and_display_tab(mh_tab, "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=GuiTableViewer.GuiTableViewer(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")
    #end def tab_table_viewer

    def tabGraphViewer(self, widget, data):
        """opens a graph viewer tab"""
        #print "start of tabGraphViewer"
        new_gv_thread=GuiGraphViewer.GuiGraphViewer(self.db, self.settings, self.querydict, self.config)
        self.threads.append(new_gv_thread)
        gv_tab=new_gv_thread.get_vbox()
        self.add_and_display_tab(gv_tab, "Graphs")
    #end def tabGraphViewer

    def __init__(self):
        self.threads=[]
        self.db=None
        self.config = Configuration.Config(dbname=options.dbname)
        self.load_profile()

        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 - v%s or higher" % (VERSION, ))
        self.window.set_border_width(1)
        self.window.set_size_request(1020,400)
        self.window.set_resizable(True)

        self.menu_items = (
                ( "/_Main",                                 None,         None, 0, "<Branch>" ),
                ( "/Main/_Load Profile (broken)",                    "<control>L", self.dia_load_profile, 0, None ),
                ( "/Main/_Edit Profile (todo)",                    "<control>E", self.dia_edit_profile, 0, None ),
                ( "/Main/_Save Profile (todo)",                    None,         self.dia_save_profile, 0, None ),
                ("/Main/sep1", None, None, 0, "<Separator>" ),
                ("/Main/_Quit", "<control>Q", self.quit, 0, None ),
                ("/_Import",                               None,         None, 0, "<Branch>" ),
                ("/Import/_Bulk Import",  "<control>B", self.tab_bulk_import, 0, None ),
                ("/Import/_Auto Import and HUD", "<control>A", self.tab_auto_import, 0, None ),
                ("/Import/Auto _Rating (todo)",                   "<control>R", self.not_implemented, 0, None ),
                ("/_Viewers", None, None, 0, "<Branch>" ),
                ("/_Viewers/_Auto Import and HUD", "<control>A", self.tab_auto_import, 0, None ),
                ("/Viewers/_Graphs", "<control>G", self.tabGraphViewer, 0, None ),
                ("/Viewers/Hand _Replayer (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/Player _Details (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/_Player Stats (tabulated view)", None, self.tab_player_stats, 0, None ),
                ("/Viewers/Positional Stats (tabulated view)", None, self.tab_positional_stats, 0, None ),
                ("/Viewers/Starting _Hands (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/_Session Replayer (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/Poker_table Viewer (mostly obselete)", "<control>T", self.tab_table_viewer, 0, None ),
                #( "/Viewers/Tourney Replayer
                ( "/_Database",                             None,         None, 0, "<Branch>" ),
                ( "/Database/Create or Delete _Database (todo)",   None,         self.dia_create_del_database, 0, None ),
                ( "/Database/Create or Delete _User (todo)",       None,         self.dia_create_del_user, 0, None ),
                ( "/Database/Create or Recreate _Tables",   None,         self.dia_recreate_tables, 0, None ),
                ( "/Database/_Statistics (todo)",                  None,         self.dia_database_stats, 0, None ),
                ( "/D_ebugging",                            None,         None, 0, "<Branch>" ),
                ( "/Debugging/_Delete Parts of Database (todo)",   None,         self.dia_delete_db_parts, 0, None ),
                ( "/Debugging/_Export DB (todo)",                  None,         self.dia_export_db, 0, None ),
                ( "/Debugging/_Import DB (todo)",                  None,         self.dia_import_db, 0, None ),
                ( "/Debugging/_Regression test (todo)",            None,         self.dia_regression_test, 0, None ),
                ( "/_Help",                                 None,         None, 0, "<LastBranch>" ),
                ( "/Help/_Main Help",                       "<control>H", self.tab_main_help, 0, None ),
                ( "/Help/_Abbrevations (todo)",                    None,         self.tab_abbreviations, 0, None ),
                ( "/Help/sep1",                             None,         None, 0, "<Separator>" ),
                ( "/Help/A_bout (todo)",                           None,         self.dia_about, 0, None ),
                ( "/Help/_License and Copying (todo)",             None,         self.dia_licensing, 0, None )
        )

        self.main_vbox = gtk.VBox(False, 1)
        self.main_vbox.set_border_width(1)
        self.window.add(self.main_vbox)
        self.main_vbox.show()

        menubar = self.get_menu(self.window)
        self.main_vbox.pack_start(menubar, False, True, 0)
        menubar.show()
        #done menubar

        self.tabs=[]
        self.tab_names=[]
        self.tab_buttons=[]
        self.tab_box = gtk.HBox(False,1)
        self.main_vbox.pack_start(self.tab_box, False, True, 0)
        self.tab_box.show()
        #done tab bar

        self.current_tab = gtk.VBox(False,1)
        self.current_tab.set_border_width(1)
        self.main_vbox.add(self.current_tab)
        self.current_tab.show()

        self.tab_main_help(None, None)

        self.status_bar = gtk.Label("Status: Connected to "+self.db.get_backend_name()+" database named "+self.db.database+" on host "+self.db.host)
        self.main_vbox.pack_end(self.status_bar, False, True, 0)
        self.status_bar.show()

        self.window.show()
    #end def __init__

    def main(self):
        gtk.main()
        return 0
    #end def main

if __name__ == "__main__":
    me = fpdb()
    me.main()
not sure what this is. should i be expecting a GUI for the body of the "tracker" of this or is it all done through editing bits of code? if i hadn't messed up the installation, would a GUI pop up after clicking the fpdb icon?

Last edited by dorado29; 08-10-2009 at 06:33 PM. Reason: obv I'm fine with going through and editing, it's free after all :)
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 06:46 PM
Quote:
Originally Posted by dorado29
nice alright I made a fpdb database in MySQL. I went into HUD_config.xml and put my password into the proper spot (lol it took forever to find the spot because its in notepad and scrolls sideways for like evarrr)

Anywho, now what do I do? When I double click the fpdb icon it opens up a white code box:

Code:
#!/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 os
import sys
from optparse import OptionParser


parser = OptionParser()
parser.add_option("-x", "--errorsToConsole", action="store_true",
                help="If passed error output will go to the console rather than .")
parser.add_option("-d", "--databaseName", dest="dbname", default="fpdb",
                help="Overrides the default database name")
(options, sys.argv) = parser.parse_args()

if not options.errorsToConsole:
    print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
    errorFile = open('fpdb-error-log.txt', 'w', 0)
    sys.stderr = errorFile

import pygtk
pygtk.require('2.0')
import gtk

import fpdb_db
import fpdb_simple
import GuiBulkImport
import GuiPlayerStats
import GuiPositionalStats
import GuiTableViewer
import GuiAutoImport
import GuiGraphViewer
import FpdbSQLQueries
import Configuration

VERSION = "0.11.3"

class fpdb:
    def tab_clicked(self, widget, tab_name):
        """called when a tab button is clicked to activate that tab"""
        #print "start of tab_clicked"
        self.display_tab(tab_name)
    #end def tab_clicked

    def add_and_display_tab(self, new_tab, new_tab_name):
        """just calls the component methods"""
        self.add_tab(new_tab, new_tab_name)
        self.display_tab(new_tab_name)
    #end def add_and_display_tab

    def add_tab(self, new_tab, new_tab_name):
        """adds a tab, namely creates the button and displays it and appends all the relevant arrays"""
        #print "start of add_tab"
        for i in self.tab_names: #todo: check this is valid
            if i==new_tab_name:
                return # we depend on this to not create duplicate tabs, there's no reason to raise an error here?
#                raise fpdb_simple.FpdbError("duplicate tab_name not permitted")

        self.tabs.append(new_tab)
        self.tab_names.append(new_tab_name)

        new_tab_sel_button=gtk.ToggleButton(new_tab_name)
        new_tab_sel_button.connect("clicked", self.tab_clicked, new_tab_name)
        self.tab_box.add(new_tab_sel_button)
        new_tab_sel_button.show()
        self.tab_buttons.append(new_tab_sel_button)
    #end def add_tab

    def display_tab(self, new_tab_name):
        """displays the indicated tab"""
        #print "start of display_tab, len(self.tab_names):",len(self.tab_names)
        tab_no = -1
        for i, name in enumerate(self.tab_names):
            if name == new_tab_name:
                tab_no = i
                break

        if tab_no == -1:
            raise fpdb_simple.FpdbError("invalid tab_no")
        else:
            self.main_vbox.remove(self.current_tab)
            #self.current_tab.destroy()
            self.current_tab=self.tabs[tab_no]
            self.main_vbox.add(self.current_tab)
            self.tab_buttons[tab_no].set_active(True)
            self.current_tab.show()
    #end def display_tab

    def delete_event(self, widget, event, data=None):
        return False
    #end def delete_event

    def destroy(self, widget, data=None):
        self.quit(widget, data)
    #end def destroy

    def dia_about(self, widget, data):
        print "todo: implement dia_about",
        print " version = %s, requires database version %s" % (VERSION, "118")
    #end def dia_about

    def dia_create_del_database(self, widget, data):
        print "todo: implement dia_create_del_database"
        self.obtain_global_lock()
    #end def dia_create_del_database

    def dia_create_del_user(self, widget, data):
        print "todo: implement dia_create_del_user"
        self.obtain_global_lock()
    #end def dia_create_del_user

    def dia_database_stats(self, widget, data):
        print "todo: implement dia_database_stats"
        #string=fpdb_db.getDbStats(db, cursor)
    #end def dia_database_stats

    def dia_delete_db_parts(self, widget, data):
        print "todo: implement dia_delete_db_parts"
        self.obtain_global_lock()
    #end def dia_delete_db_parts

    def dia_edit_profile(self, widget=None, data=None, create_default=False, path=None):
        print "todo: implement dia_edit_profile"
        self.obtain_global_lock()
    #end def dia_edit_profile

    def dia_export_db(self, widget, data):
        print "todo: implement dia_export_db"
        self.obtain_global_lock()
    #end def dia_export_db

    def dia_get_db_root_credentials(self):
        """obtains db root credentials from user"""
        print "todo: implement dia_get_db_root_credentials"
#        user, pw=None, None
#        
#        dialog=gtk.Dialog(title="DB Credentials needed", parent=None, flags=0,
#                buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,"Connect and recreate",gtk.RESPONSE_OK))
#        
#        label_warning1=gtk.Label("Please enter credentials for a database user for "+self.host+" that has permissions to create a database.")
#        
#        
#        label_user=gtk.Label("Username")
#        dialog.vbox.add(label_user)
#        label_user.show()
#        
#        response=dialog.run()
#        dialog.destroy()
#        return (user, pw, response)
    #end def dia_get_db_root_credentials

    def dia_import_db(self, widget, data):
        print "todo: implement dia_import_db"
        self.obtain_global_lock()
    #end def dia_import_db

    def dia_licensing(self, widget, data):
        print "todo: implement dia_licensing"
    #end def dia_licensing

    def dia_load_profile(self, widget, data):
        """Dialogue to select a file to load a profile from"""
        self.obtain_global_lock()
        chooser = gtk.FileChooserDialog(title="Please select a profile file to load",
                action=gtk.FILE_CHOOSER_ACTION_OPEN,
                buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
        chooser.set_filename(self.profile)

        response = chooser.run()
        chooser.destroy()    
        if response == gtk.RESPONSE_OK:
            self.load_profile(chooser.get_filename())
        elif response == gtk.RESPONSE_CANCEL:
            print 'User cancelled loading profile'
    #end def dia_load_profile

    def dia_recreate_tables(self, widget, data):
        """Dialogue that asks user to confirm that he wants to delete and recreate the tables"""
        self.obtain_global_lock()
        
        dia_confirm = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING,
                buttons=(gtk.BUTTONS_YES_NO), message_format="Confirm deleting and recreating tables")
        diastring = "Please confirm that you want to (re-)create the tables. If there already are tables in the database "+self.db.database+" on "+self.db.host+" they will be deleted."
        dia_confirm.format_secondary_text(diastring)#todo: make above string with bold for db, host and deleted

        response = dia_confirm.run()
        dia_confirm.destroy()
        if response == gtk.RESPONSE_YES:
            self.db.recreate_tables()
        elif response == gtk.RESPONSE_NO:
            print 'User cancelled recreating tables'
    #end def dia_recreate_tables

    def dia_regression_test(self, widget, data):
        print "todo: implement dia_regression_test"
        self.obtain_global_lock()
    #end def dia_regression_test

    def dia_save_profile(self, widget, data):
        print "todo: implement dia_save_profile"
    #end def dia_save_profile

    def diaSetupWizard(self, path):
        print "todo: implement setup wizard"
        print "setup wizard not implemented - please create the default configuration file:", path    
        diaSetupWizard = gtk.Dialog(title="Fatal Error - Config File Missing", parent=None, flags=0, buttons=(gtk.STOCK_QUIT,gtk.RESPONSE_OK))

        label = gtk.Label("Please copy the config file from the docs folder to:")
        diaSetupWizard.vbox.add(label)
        label.show()

        label = gtk.Label(path)
        diaSetupWizard.vbox.add(label)
        label.show()

        label = gtk.Label("and edit it according to the install documentation at http://fpdb.****************")
        diaSetupWizard.vbox.add(label)
        label.show()

        response = diaSetupWizard.run()
        sys.exit(1)
    #end def diaSetupWizard

    def get_menu(self, window):
        """returns the menu for this program"""
        accel_group = gtk.AccelGroup()
        self.item_factory = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group)
        self.item_factory.create_items(self.menu_items)
        window.add_accel_group(accel_group)
        return self.item_factory.get_widget("<main>")
    #end def get_menu

    def load_profile(self):
        """Loads profile from the provided path name."""
        self.settings = {}
        if (os.sep=="/"):
            self.settings['os']="linuxmac"
        else:
            self.settings['os']="windows"

        self.settings.update(self.config.get_db_parameters())
        self.settings.update(self.config.get_tv_parameters())
        self.settings.update(self.config.get_import_parameters())
        self.settings.update(self.config.get_default_paths())

        if self.db!=None:
            self.db.disconnect()

        self.db = fpdb_db.fpdb_db()
        #print "end of fpdb.load_profile, databaseName:",self.settings['db-databaseName']
        self.db.connect(self.settings['db-backend'],
            self.settings['db-host'],
            self.settings['db-databaseName'],
            self.settings['db-user'], 
            self.settings['db-password'])
        if self.db.wrongDbVersion:
            diaDbVersionWarning = gtk.Dialog(title="Strong Warning - Invalid database version", parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK))

            label = gtk.Label("An invalid DB version or missing tables have been detected.")
            diaDbVersionWarning.vbox.add(label)
            label.show()

            label = gtk.Label("This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu.")
            diaDbVersionWarning.vbox.add(label)
            label.show()

            label = gtk.Label("Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc.")
            diaDbVersionWarning.vbox.add(label)
            label.show()

            response = diaDbVersionWarning.run()
            diaDbVersionWarning.destroy()

        # Database connected to successfully, load queries to pass on to other classes
        self.querydict = FpdbSQLQueries.FpdbSQLQueries(self.db.get_backend_name())
    #end def load_profile

    def not_implemented(self):
        print "todo: called unimplemented menu entry (users: pls ignore this)"#remove this once more entries are implemented
    #end def not_implemented

    def obtain_global_lock(self):
        print "todo: implement obtain_global_lock (users: pls ignore this)"
    #end def obtain_global_lock

    def quit(self, widget, data):
        print "Quitting normally"
        #check if current settings differ from profile, if so offer to save or abort
        self.db.disconnect()
        gtk.main_quit()
    #end def quit_cliecked

    def release_global_lock(self):
        print "todo: implement release_global_lock"
    #end def release_global_lock

    def tab_abbreviations(self, widget, data):
        print "todo: implement tab_abbreviations"
    #end def tab_abbreviations

    def tab_auto_import(self, widget, data):
        """opens the auto import tab"""
        new_aimp_thread=GuiAutoImport.GuiAutoImport(self.settings, self.config)
        self.threads.append(new_aimp_thread)
        aimp_tab=new_aimp_thread.get_vbox()
        self.add_and_display_tab(aimp_tab, "Auto Import")
    #end def tab_auto_import

    def tab_bulk_import(self, widget, data):
        """opens a tab for bulk importing"""
        #print "start of tab_bulk_import"
        new_import_thread=GuiBulkImport.GuiBulkImport(self.db, self.settings, self.config)
        self.threads.append(new_import_thread)
        bulk_tab=new_import_thread.get_vbox()
        self.add_and_display_tab(bulk_tab, "Bulk Import")
    #end def tab_bulk_import

    def tab_player_stats(self, widget, data):
        new_ps_thread=GuiPlayerStats.GuiPlayerStats(self.db, self.config, self.querydict)
        self.threads.append(new_ps_thread)
        ps_tab=new_ps_thread.get_vbox()
        self.add_and_display_tab(ps_tab, "Player Stats")

    def tab_positional_stats(self, widget, data):
        new_ps_thread=GuiPositionalStats.GuiPositionalStats(self.db, self.config, self.querydict)
        self.threads.append(new_ps_thread)
        ps_tab=new_ps_thread.get_vbox()
        self.add_and_display_tab(ps_tab, "Positional Stats")


    def tab_main_help(self, widget, data):
        """Displays a tab with the main fpdb help screen"""
        #print "start of tab_main_help"
        mh_tab=gtk.Label("""Welcome to Fpdb!
For documentation please visit our website at http://fpdb.****************/ or check the docs directory in the fpdb folder.
Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml
This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
        self.add_and_display_tab(mh_tab, "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=GuiTableViewer.GuiTableViewer(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")
    #end def tab_table_viewer

    def tabGraphViewer(self, widget, data):
        """opens a graph viewer tab"""
        #print "start of tabGraphViewer"
        new_gv_thread=GuiGraphViewer.GuiGraphViewer(self.db, self.settings, self.querydict, self.config)
        self.threads.append(new_gv_thread)
        gv_tab=new_gv_thread.get_vbox()
        self.add_and_display_tab(gv_tab, "Graphs")
    #end def tabGraphViewer

    def __init__(self):
        self.threads=[]
        self.db=None
        self.config = Configuration.Config(dbname=options.dbname)
        self.load_profile()

        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 - v%s or higher" % (VERSION, ))
        self.window.set_border_width(1)
        self.window.set_size_request(1020,400)
        self.window.set_resizable(True)

        self.menu_items = (
                ( "/_Main",                                 None,         None, 0, "<Branch>" ),
                ( "/Main/_Load Profile (broken)",                    "<control>L", self.dia_load_profile, 0, None ),
                ( "/Main/_Edit Profile (todo)",                    "<control>E", self.dia_edit_profile, 0, None ),
                ( "/Main/_Save Profile (todo)",                    None,         self.dia_save_profile, 0, None ),
                ("/Main/sep1", None, None, 0, "<Separator>" ),
                ("/Main/_Quit", "<control>Q", self.quit, 0, None ),
                ("/_Import",                               None,         None, 0, "<Branch>" ),
                ("/Import/_Bulk Import",  "<control>B", self.tab_bulk_import, 0, None ),
                ("/Import/_Auto Import and HUD", "<control>A", self.tab_auto_import, 0, None ),
                ("/Import/Auto _Rating (todo)",                   "<control>R", self.not_implemented, 0, None ),
                ("/_Viewers", None, None, 0, "<Branch>" ),
                ("/_Viewers/_Auto Import and HUD", "<control>A", self.tab_auto_import, 0, None ),
                ("/Viewers/_Graphs", "<control>G", self.tabGraphViewer, 0, None ),
                ("/Viewers/Hand _Replayer (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/Player _Details (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/_Player Stats (tabulated view)", None, self.tab_player_stats, 0, None ),
                ("/Viewers/Positional Stats (tabulated view)", None, self.tab_positional_stats, 0, None ),
                ("/Viewers/Starting _Hands (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/_Session Replayer (todo)", None, self.not_implemented, 0, None ),
                ("/Viewers/Poker_table Viewer (mostly obselete)", "<control>T", self.tab_table_viewer, 0, None ),
                #( "/Viewers/Tourney Replayer
                ( "/_Database",                             None,         None, 0, "<Branch>" ),
                ( "/Database/Create or Delete _Database (todo)",   None,         self.dia_create_del_database, 0, None ),
                ( "/Database/Create or Delete _User (todo)",       None,         self.dia_create_del_user, 0, None ),
                ( "/Database/Create or Recreate _Tables",   None,         self.dia_recreate_tables, 0, None ),
                ( "/Database/_Statistics (todo)",                  None,         self.dia_database_stats, 0, None ),
                ( "/D_ebugging",                            None,         None, 0, "<Branch>" ),
                ( "/Debugging/_Delete Parts of Database (todo)",   None,         self.dia_delete_db_parts, 0, None ),
                ( "/Debugging/_Export DB (todo)",                  None,         self.dia_export_db, 0, None ),
                ( "/Debugging/_Import DB (todo)",                  None,         self.dia_import_db, 0, None ),
                ( "/Debugging/_Regression test (todo)",            None,         self.dia_regression_test, 0, None ),
                ( "/_Help",                                 None,         None, 0, "<LastBranch>" ),
                ( "/Help/_Main Help",                       "<control>H", self.tab_main_help, 0, None ),
                ( "/Help/_Abbrevations (todo)",                    None,         self.tab_abbreviations, 0, None ),
                ( "/Help/sep1",                             None,         None, 0, "<Separator>" ),
                ( "/Help/A_bout (todo)",                           None,         self.dia_about, 0, None ),
                ( "/Help/_License and Copying (todo)",             None,         self.dia_licensing, 0, None )
        )

        self.main_vbox = gtk.VBox(False, 1)
        self.main_vbox.set_border_width(1)
        self.window.add(self.main_vbox)
        self.main_vbox.show()

        menubar = self.get_menu(self.window)
        self.main_vbox.pack_start(menubar, False, True, 0)
        menubar.show()
        #done menubar

        self.tabs=[]
        self.tab_names=[]
        self.tab_buttons=[]
        self.tab_box = gtk.HBox(False,1)
        self.main_vbox.pack_start(self.tab_box, False, True, 0)
        self.tab_box.show()
        #done tab bar

        self.current_tab = gtk.VBox(False,1)
        self.current_tab.set_border_width(1)
        self.main_vbox.add(self.current_tab)
        self.current_tab.show()

        self.tab_main_help(None, None)

        self.status_bar = gtk.Label("Status: Connected to "+self.db.get_backend_name()+" database named "+self.db.database+" on host "+self.db.host)
        self.main_vbox.pack_end(self.status_bar, False, True, 0)
        self.status_bar.show()

        self.window.show()
    #end def __init__

    def main(self):
        gtk.main()
        return 0
    #end def main

if __name__ == "__main__":
    me = fpdb()
    me.main()
not sure what this is. should i be expecting a GUI for the body of the "tracker" of this or is it all done through editing bits of code? if i hadn't messed up the installation, would a GUI pop up after clicking the fpdb icon?
You appear to have inadvertently set the default action for when you double-click a .py file to open it in the editor. Try right-clicking and choosing execute or run or something. I'm sure you can reset the default double-click action back to execute, but I have no idea how.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 11:45 PM


just to confirm, it's this one amirite? when right clicking, there is nothing along the lines of execute, run or something of that nature. Theres an "extract without confirmation," but idk what that does. I'll probs give it a shot

nothing happened afaik. error code still looks the same
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote
08-10-2009 , 11:55 PM
Quote:
Originally Posted by dorado29


just to confirm, it's this one amirite? when right clicking, there is nothing along the lines of execute, run or something of that nature. Theres an "extract without confirmation," but idk what that does. I'll probs give it a shot

nothing happened afaik. error code still looks the same
fpdb.py is the correct file.

I think you've reset the file assocation for .py files to notepad.


A quick Google gives:
Code:
Go Start -> Default Programs

Choose Associate a file type or protocol with a program

Select your .py extension and click Change program...

Choose the executable you want to run your .py files.
python.exe is what you are looking for.
Free, open source poker tracking software: FPDB - (Version 0.40.5) - Nov 14, 2013 Quote

      
m