From fbfaf0176c1e0b3ef3231c08691ff9c30b22330b Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 17 Sep 2010 10:58:47 +0800 Subject: [PATCH] Import: First step to making FTP archive files parse Change regex to be explicit about the number of '*'s Pass the ftpArchive flag to HHC init --- pyfpdb/HandHistoryConverter.py | 3 ++- pyfpdb/fpdb_import.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 8eb2b9b6..c52444dd 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -266,7 +266,8 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py. if self.ftpArchive == True: log.debug(_("Converting ftpArchive format to readable")) - m = re.compile('^\*\*\*\*\*\*+\s#\s\d+\s\*\*\*\*\*+$', re.MULTILINE) + # Remove ******************** # 1 ************************* + m = re.compile('\*{20}\s#\s\d+\s\*{25}\s+', re.MULTILINE) self.obs = m.sub('', self.obs) if self.obs is None or self.obs == "": diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 102da6fc..65de8181 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -473,7 +473,8 @@ class Importer: else: self.pos_in_file[file] = 0 hhc = obj( self.config, in_path = file, out_path = out_path, index = idx - , starsArchive = self.settings['starsArchive'], sitename = site ) + , starsArchive = self.settings['starsArchive'], ftpArchive = self.settings['ftpArchive'], + sitename = site ) if hhc.getStatus(): handlist = hhc.getProcessedHands() self.pos_in_file[file] = hhc.getLastCharacterRead()