From bdb0bda3a0dd1ce4f4f01cad65f25600106c7946 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 9 Sep 2010 10:31:40 +0800 Subject: [PATCH] OnGame: remove non-digits from hand id Fixing email reported error with MySQL: fpdb starting ...Traceback (most recent call last): File "GuiBulkImport.pyc", line 107, in load_clicked File "fpdb_import.pyc", line 251, in runImport File "fpdb_import.pyc", line 314, in importFiles File "fpdb_import.pyc", line 482, in import_file_dict File "Hand.pyc", line 273, in insert File "Database.pyc", line 1651, in storeHand File "MySQLdb\cursors.pyc", line 174, in execute File "MySQLdb\connections.pyc", line 36, in defaulterrorhandler _mysql_exceptions.OperationalError: (1366, "Incorrect integer value: 'R5-79731715-280' for column 'siteHandNo' at row 1") --- pyfpdb/OnGameToFpdb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index ae5549cc..94d9afbc 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -229,6 +229,9 @@ class OnGame(HandHistoryConverter): hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, tzoffset, "UTC") if key == 'HID': hand.handid = info[key] + # Need to remove non-alphanumerics for MySQL + hand.handid = hand.handid.replace('R','') + hand.handid = hand.handid.replace('-','') if key == 'TABLE': hand.tablename = info[key]