]> code.communitydata.science - mediawiki_dump_tools.git/blobdiff - wikiq
regex scanner groups findall tuple bug fixed
[mediawiki_dump_tools.git] / wikiq
diff --git a/wikiq b/wikiq
index 0dad9e32deb3fea6345d0e7c9a68e58239a7dde6..f15eee6b425ce7822c39f2b3a48eb1d249696515 100755 (executable)
--- a/wikiq
+++ b/wikiq
@@ -189,7 +189,17 @@ class RegexPair(object):
                 #given that there are matches to be made\r
                 if self.pattern.search(content) is not None:\r
                     m = self.pattern.findall(content)\r
-                    temp_dict[self.label] = ', '.join(m)\r
+                    m_fixed = []\r
+                    for match in m:\r
+                        if type(match) is tuple:\r
+                            matchies = set()\r
+                            for sub_m in match:\r
+                                matchies.add(sub_m)\r
+                            m_fixed += matchies\r
+                        else:\r
+                            m_fixed.append(match)\r
+\r
+                    temp_dict[self.label] = ', '.join(m_fixed)\r
                 else:\r
                     temp_dict[self.label] = None    \r
         \r

Community Data Science Collective || Want to submit a patch?