From e56cb24ed11ff00416e58a99737288c0230a7b37 Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Fri, 29 Jan 2010 12:01:51 -0500 Subject: [PATCH 1/7] to_utf8 returns what was passed in if unicode() errors because it's already encoded --- pyfpdb/Charset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Charset.py b/pyfpdb/Charset.py index d49b6219..5851683a 100644 --- a/pyfpdb/Charset.py +++ b/pyfpdb/Charset.py @@ -42,6 +42,8 @@ def to_utf8(s): except UnicodeDecodeError: sys.stderr.write('Could not convert: "%s"\n' % s) raise + except TypeError: # TypeError is raised when we give unicode() an already encoded string + return s def to_db_utf8(s): if not_needed: return s @@ -62,4 +64,3 @@ def to_gui(s): except UnicodeDecodeError: sys.stderr.write('Could not convert: "%s"\n' % s) raise - From f7ac36f3bbfe79c4da3b094aa624fdeafe503732 Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Fri, 29 Jan 2010 17:44:58 -0500 Subject: [PATCH 2/7] add getTableTitleRe to everleaf filter, doesn't seem to work --- pyfpdb/EverleafToFpdb.py | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index fcd76c25..ad9d0524 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -2,12 +2,12 @@ # -*- coding: utf-8 -*- # # Copyright 2008, Carl Gherardi -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -25,7 +25,7 @@ from HandHistoryConverter import * # Class for converting Everleaf HH format. class Everleaf(HandHistoryConverter): - + sitename = 'Everleaf' filetype = "text" codepage = "cp1252" @@ -40,8 +40,8 @@ class Everleaf(HandHistoryConverter): re_Button = re.compile(ur"^Seat (?P