From a93562c22959f69e8c58f567909420ab1436c725 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Wed, 10 Feb 2010 23:33:50 +0000 Subject: [PATCH] make fpdb and hud write separate log files, refine py2exe some more --- pyfpdb/Configuration.py | 9 ++++++--- pyfpdb/GuiGraphViewer.py | 2 +- pyfpdb/HUD_main.py | 3 ++- pyfpdb/fpdb.py | 2 +- pyfpdb/py2exe_setup.py | 10 ++++++++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 7b026f0c..6c4eecd2 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -105,14 +105,17 @@ def get_config(file_name, fallback = True): sys.exit() return (file_name,True) -def get_logger(file_name, config = "config", fallback = False, log_dir=None): +def get_logger(file_name, config = "config", fallback = False, log_dir=None, log_file=None): (conf_file,copied) = get_config(file_name, fallback = fallback) if log_dir is None: log_dir = os.path.join(get_exec_path(), 'log') #print "\nget_logger: checking log_dir:", log_dir check_dir(log_dir) - file = os.path.join(log_dir, 'logging.out') + if log_file is None: + file = os.path.join(log_dir, 'fpdb-log.txt') + else: + file = os.path.join(log_dir, log_file) if conf_file: try: @@ -469,7 +472,7 @@ class Config: self.dir_config = os.path.dirname(self.file) self.dir_log = os.path.join(self.dir_config, 'log') self.dir_database = os.path.join(self.dir_config, 'database') - self.log_file = os.path.join(self.dir_log, 'logging.out') + self.log_file = os.path.join(self.dir_log, 'fpdb-log.txt') log = get_logger("logging.conf", "config", log_dir=self.dir_log) # Parse even if there was no real config file found and we are using the example diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index dcfa979c..eb1793d3 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -27,7 +27,7 @@ from time import * try: import matplotlib - matplotlib.use('GTK') + matplotlib.use('GTKCairo') from matplotlib.figure import Figure from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 5a3ee2dd..03f6c565 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -72,7 +72,8 @@ class HUD_main(object): print "\nHUD_main: starting ..." self.db_name = db_name self.config = Configuration.Config(file=options.config, dbname=db_name) - log = Configuration.get_logger("logging.conf", "hud", log_dir=self.config.dir_log) + log = Configuration.get_logger("logging.conf", "hud", log_dir=self.config.dir_log, log_file='HUD-log.txt') + print "Logfile is " + os.path.join(self.config.dir_log, 'HUD-log.txt') log.info("HUD_main starting: using db name = %s" % (db_name)) try: diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 43121804..55b19a3b 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -689,7 +689,7 @@ class fpdb: """Loads profile from the provided path name.""" self.config = Configuration.Config(file=options.config, dbname=options.dbname) log = Configuration.get_logger("logging.conf", "fpdb", log_dir=self.config.dir_log) - print "Logfile is " + os.path.join(self.config.dir_log, 'logging.out') + "\n" + print "Logfile is " + os.path.join(self.config.dir_log, self.config.log_file) + "\n" if self.config.example_copy: self.info_box( "Config file" , "has been created at:\n%s.\n" % self.config.file diff --git a/pyfpdb/py2exe_setup.py b/pyfpdb/py2exe_setup.py index 32d6d19b..9975317f 100644 --- a/pyfpdb/py2exe_setup.py +++ b/pyfpdb/py2exe_setup.py @@ -53,7 +53,7 @@ Py2exe script for fpdb. # sqlcoder notes: this worked for me with the following notes: #- I used the following versions: # python 2.5.4 -# gtk+ 2.14.7 +# gtk+ 2.14.7 (gtk_2.14.7-20090119) # pycairo 1.4.12-2 # pygobject 2.14.2-2 # pygtk 2.12.1-3 @@ -137,7 +137,13 @@ setup( options = {'py2exe': { 'packages' : ['encodings', 'matplotlib'], 'includes' : ['cairo', 'pango', 'pangocairo', 'atk', 'gobject' - ,'PokerStarsToFpdb', 'matplotlib.numerix.random_array'], + ,'matplotlib.numerix.random_array' + ,'AbsoluteToFpdb', 'BetfairToFpdb' + ,'CarbonToFpdb', 'EverleafToFpdb' + ,'FulltiltToFpdb', 'OnGameToFpdb' + ,'PartyPokerToFpdb', 'PokerStarsToFpdb' + ,'UltimateBetToFpdb', 'Win2dayToFpdb' + ], 'excludes' : ['_tkagg', '_agg2', 'cocoaagg', 'fltkagg'], # surely we need this? '_gtkagg' 'dll_excludes': ['libglade-2.0-0.dll', 'libgdk-win32-2.0-0.dll' ,'libgobject-2.0-0.dll'],