From ae59fa715b6bd56cfd65a52c7f281e46630ce410 Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Sat, 20 Feb 2010 11:24:07 -0500 Subject: [PATCH] Correctly pass dbname to config. Clean some pylint complaints. --- pyfpdb/HUD_main.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 2ea223f4..92f888d8 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -61,7 +61,7 @@ import Hud # get config and set up logger -c = Configuration.Config(file=options.config) +c = Configuration.Config(file=options.config, dbname=options.dbname) log = Configuration.get_logger("logging.conf", "hud", log_dir=c.dir_log, log_file='HUD-log.txt') @@ -78,14 +78,14 @@ class HUD_main(object): try: if not options.errorsToConsole: - fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt') - print "Note: error output is being diverted to:\n"+fileName \ - + "\nAny major error will be reported there _only_.\n" - log.info("Note: error output is being diverted to:"+fileName) - log.info("Any major error will be reported there _only_.") - errorFile = open(fileName, 'w', 0) - sys.stderr = errorFile - sys.stderr.write("HUD_main: starting ...\n") + fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt') + print "Note: error output is being diverted to:\n"+fileName \ + + "\nAny major error will be reported there _only_.\n" + log.info("Note: error output is being diverted to:"+fileName) + log.info("Any major error will be reported there _only_.") + errorFile = open(fileName, 'w', 0) + sys.stderr = errorFile + sys.stderr.write("HUD_main: starting ...\n") self.hud_dict = {} self.hud_params = self.config.get_hud_ui_parameters() @@ -237,7 +237,7 @@ class HUD_main(object): try: (table_name, max, poker_game, type, site_id, site_name, num_seats, tour_number, tab_number) = \ self.db_connection.get_table_info(new_hand_id) - except Exception, err: + except Exception: log.error("db error: skipping %s" % new_hand_id) continue t1 = time.time()