diff --git a/pyfpdb/Card.py b/pyfpdb/Card.py index 23a0b7c4..46d56262 100755 --- a/pyfpdb/Card.py +++ b/pyfpdb/Card.py @@ -140,10 +140,10 @@ def valueSuitFromCard(card): return suitFromCardList[card] encodeCardList = {'2h': 1, '3h': 2, '4h': 3, '5h': 4, '6h': 5, '7h': 6, '8h': 7, '9h': 8, 'Th': 9, 'Jh': 10, 'Qh': 11, 'Kh': 12, 'Ah': 13, - '2d': 14, '3d': 15, '4d': 16, '5d': 17, '6d': 18, '7d': 19, '8d': 20, '9d': 21, 'Td': 22, 'Jd': 23, 'Qd': 24, 'Kd': 25, 'Ad': 26, - '2c': 27, '3c': 28, '4c': 29, '5c': 30, '6c': 31, '7c': 32, '8c': 33, '9c': 34, 'Tc': 35, 'Jc': 36, 'Qc': 27, 'Kc': 38, 'Ac': 39, - '2s': 40, '3s': 41, '4s': 42, '5s': 43, '6s': 44, '7s': 45, '8s': 46, '9s': 47, 'Ts': 48, 'Js': 49, 'Qs': 50, 'Ks': 51, 'As': 52, - ' ': 0 + '2d': 14, '3d': 15, '4d': 16, '5d': 17, '6d': 18, '7d': 19, '8d': 20, '9d': 21, 'Td': 22, 'Jd': 23, 'Qd': 24, 'Kd': 25, 'Ad': 26, + '2c': 27, '3c': 28, '4c': 29, '5c': 30, '6c': 31, '7c': 32, '8c': 33, '9c': 34, 'Tc': 35, 'Jc': 36, 'Qc': 37, 'Kc': 38, 'Ac': 39, + '2s': 40, '3s': 41, '4s': 42, '5s': 43, '6s': 44, '7s': 45, '8s': 46, '9s': 47, 'Ts': 48, 'Js': 49, 'Qs': 50, 'Ks': 51, 'As': 52, + ' ': 0 } def encodeCard(cardString): diff --git a/pyfpdb/Charset.py b/pyfpdb/Charset.py index 6b5e6b7c..ea19d32e 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_needed2: return s @@ -62,4 +64,3 @@ def to_gui(s): except UnicodeDecodeError: sys.stderr.write('Could not convert: "%s"\n' % s) raise - 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