diff --git a/gfx/fpdb_large_icon.ico b/gfx/fpdb_large_icon.ico new file mode 100644 index 00000000..6be85f1c Binary files /dev/null and b/gfx/fpdb_large_icon.ico differ diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 192124e5..b55c9ec1 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -193,12 +193,13 @@ class GuiAutoImport (threading.Thread): self.doAutoImportBool = True widget.set_label(u' _Stop Autoimport ') if self.pipe_to_hud is None: - if os.name == 'nt': - if sys.argv[0] == 'fpdb.exe': - command = 'HUD_main.exe' - else: - path = sys.path[0].replace('\\','\\\\') - command = 'python "'+path+'\\HUD_main.py" ' + self.settings['cl_options'] + if Configuration.FROZEN: + path = Configuration.EXEC_PATH + command = "HUD_main.exe" + bs = 0 + elif os.name == 'nt': + path = sys.path[0].replace('\\','\\\\') + command = 'python "'+path+'\\HUD_main.py" ' + self.settings['cl_options'] bs = 0 else: command = os.path.join(sys.path[0], 'HUD_main.py') @@ -206,6 +207,7 @@ class GuiAutoImport (threading.Thread): bs = 1 try: + print "opening pipe to HUD" self.pipe_to_hud = subprocess.Popen(command, bufsize=bs, stdin=subprocess.PIPE, universal_newlines=True) diff --git a/pyfpdb/Options.py b/pyfpdb/Options.py index ab226124..6570dbe4 100644 --- a/pyfpdb/Options.py +++ b/pyfpdb/Options.py @@ -15,9 +15,9 @@ #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 +# http://docs.python.org/library/optparse.html def fpdb_options(): @@ -41,6 +41,14 @@ def fpdb_options(): parser.add_option("-k", "--konverter", dest="hhc", default="PokerStarsToFpdb", help="Module name for Hand History Converter") + parser.add_option("-l", "--logging", + dest = "log_level", + choices = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'EMPTY'), + help = "Error logging level. (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)", + default = 'EMPTY') + parser.add_option("-v", "--version", action = "store_true", + help = "Print version information and exit.") + (options, argv) = parser.parse_args() return (options, argv) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 340d12b9..43121804 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -796,8 +796,11 @@ class fpdb: # TODO: can we get some / all of the stuff done in this function to execute on any kind of abort? print "Quitting normally" # TODO: check if current settings differ from profile, if so offer to save or abort - if self.db is not None and self.db.connected: - self.db.disconnect() + try: + if self.db is not None and self.db.connected: + self.db.disconnect() + except _mysql_exceptions.OperationalError: # oh, damn, we're already disconnected + pass self.statusIcon.set_visible(False) gtk.main_quit() diff --git a/pyfpdb/py2exe_setup.py b/pyfpdb/py2exe_setup.py index 28f13cc1..671d58a5 100644 --- a/pyfpdb/py2exe_setup.py +++ b/pyfpdb/py2exe_setup.py @@ -100,7 +100,7 @@ setup( description = 'Free Poker DataBase', version = '0.12', - console = [ {'script': 'fpdb.py', }, + console = [ {'script': 'fpdb.py', "icon_resources": [(1, "../gfx/fpdb_large_icon.ico")]}, {'script': 'HUD_main.py', }, {'script': 'Configuration.py', } ],