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
This commit is contained in:
Worros 2010-09-17 10:58:47 +08:00
parent aae1ad082e
commit fbfaf0176c
2 changed files with 4 additions and 2 deletions

View File

@ -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 == "":

View File

@ -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()