From f6232004ad64bafecbe0d17bdd7ef7117e111ea2 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 16 Jul 2010 20:37:53 +0200 Subject: [PATCH] PSS: PS summary import now supports non-ascii playernames in sqlite --- pyfpdb/Database.py | 8 ++++---- pyfpdb/TourneySummary.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 9a5606f6..177938b2 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -856,7 +856,7 @@ class Database: def get_player_id(self, config, siteName, playerName): c = self.connection.cursor() siteNameUtf = Charset.to_utf8(siteName) - playerNameUtf = Charset.to_utf8(playerName) + playerNameUtf = unicode(playerName) #print "db.get_player_id siteName",siteName,"playerName",playerName c.execute(self.sql.query['get_player_id'], (playerNameUtf, siteNameUtf)) row = c.fetchone() @@ -2040,9 +2040,9 @@ class Database: setattr(hand, ev, resultDict[ev]) elif getattr(hand, ev)!=None and resultDict[ev]==None:#object has this value but DB doesnt, so update DB updateDb=True - elif ev=="startTime": - if (resultDict[ev] < hand.startTime): - hand.startTime=resultDict[ev] + #elif ev=="startTime": + # if (resultDict[ev] < hand.startTime): + # hand.startTime=resultDict[ev] if updateDb: cursor.execute (self.sql.query['updateTourney'].replace('%s', self.sql.query['placeholder']), (hand.entries, hand.prizepool, hand.startTime, hand.endTime, hand.tourneyName, diff --git a/pyfpdb/TourneySummary.py b/pyfpdb/TourneySummary.py index b8045104..4e02ace8 100644 --- a/pyfpdb/TourneySummary.py +++ b/pyfpdb/TourneySummary.py @@ -197,7 +197,7 @@ class TourneySummary(object): for player in self.players: id=self.db.get_player_id(self.config, self.siteName, player) if not id: - id=self.db.insertPlayer(player, self.siteId) + id=self.db.insertPlayer(unicode(player), self.siteId) self.playerIds.update({player:id}) #print "TS.insert players",self.players,"playerIds",self.playerIds