From 27446659f9f1ab263554af9fdca8c755691b4ff3 Mon Sep 17 00:00:00 2001 From: Chaz Littlejohn Date: Sun, 10 Apr 2011 16:36:30 +0000 Subject: [PATCH] Fixed the loop in storeHudCache so that it only changes boolean to 1/0 when its True/False --- pyfpdb/Configuration.py | 2 ++ pyfpdb/Database.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 22395970..8b9ed376 100644 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -208,6 +208,8 @@ DATABASE_TYPES = ( ) LOCALE_ENCODING = locale.getdefaultlocale()[1] +if not LOCALE_ENCODING: + LOCALE_ENCODING = locale.getpreferredencoding() #LOCALE_ENCODING = locale.getpreferredencoding() #this breaks on Mac OSX - please leave this comment if LOCALE_ENCODING == "US-ASCII": print _("Default encoding set to US-ASCII, defaulting to CP1252 instead -- If you're not on a Mac, please report this problem.") diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 72028d30..6a491cd3 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -2211,8 +2211,8 @@ class Database: hc['tourneyTypeId'] = pdata[p]['tourneyTypeId'] hc['styleKey'] = styleKey for i in range(len(line)): - if line[i]: line[i] = 1 - else: line[i] = 0 + if line[i]==True: line[i] = 1 + if line[i]==False: line[i] = 0 hc['line'] = line hc['game'] = [hc['gametypeId'] ,hc['playerId']