diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-25 11:40:08 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-25 11:40:08 +0200 |
commit | 43cb869972055ea2e56b94e227a9406ccccba762 (patch) | |
tree | e0ca8ef7f434c5b6284ffbc28870ff36d9979c33 /ishtar_common | |
parent | 4a6e7ca5e19703a967da0fda4fa9c9cd50ed2152 (diff) | |
download | Ishtar-43cb869972055ea2e56b94e227a9406ccccba762.tar.bz2 Ishtar-43cb869972055ea2e56b94e227a9406ccccba762.zip |
data importer: multi regex management
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/data_importer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index baf943068..974c63e44 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1262,8 +1262,13 @@ class Importer(object): unicode(self.ERRORS['regex_not_match']) + val)) c_row.append("") return - val_group = [v.replace(NEW_LINE_BREAK, '\n') if v else '' - for v in match.groups()] + val_group = [] + for g in formater.regexp.findall(val): + if isinstance(g, (tuple, list)): + g = u"".join(g) + val_group.append( + g.replace(NEW_LINE_BREAK, '\n') if g else '' + ) else: val_group = [val] |