From 6ce42df7341400d184118cc64c865a27cd8b7915 Mon Sep 17 00:00:00 2001 From: Chaz Date: Tue, 12 Oct 2010 22:47:22 -0400 Subject: [PATCH] Fixed a re matching problem for sites (OnGame, Carbon) which include char after the newline in re_SplitHands --- pyfpdb/SplitHandHistory.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pyfpdb/SplitHandHistory.py b/pyfpdb/SplitHandHistory.py index 76760ab0..aa6c2871 100644 --- a/pyfpdb/SplitHandHistory.py +++ b/pyfpdb/SplitHandHistory.py @@ -44,6 +44,7 @@ class SplitHandHistory: self.archive = archive self.re_SplitHands = None self.line_delimiter = None + self.line_addendum = None self.filedone = False #Acquire re_SplitHands for this hh @@ -52,15 +53,20 @@ class SplitHandHistory: mod = __import__(filter) obj = getattr(mod, filter_name, None) self.re_SplitHands = obj.re_SplitHands + #Determine line delimiter type if any if self.re_SplitHands.match('\n\n'): self.line_delimiter = '\n\n' - elif self.re_SplitHands.match('\n\n\n'): + if self.re_SplitHands.match('\n\n\n'): self.line_delimiter = '\n\n\n' - else: - pass - - #Open the gargantuan file + + #Add new line addendum for sites which match SplitHand to next line as well + if site == 'OnGame': + self.line_addendum = '*' + if site == 'Carbon': + self.line_addendum = '