[Collab-qa-commits] r2298 - udd/udd

Andreas Tille tille at alioth.debian.org
Wed May 9 08:40:59 UTC 2012


Author: tille
Date: 2012-05-09 08:40:58 +0000 (Wed, 09 May 2012)
New Revision: 2298

Modified:
   udd/udd/bibref_gatherer.py
Log:
Detect even more problematic author fields containing ',' instead of ' and ' and log these issues


Modified: udd/udd/bibref_gatherer.py
===================================================================
--- udd/udd/bibref_gatherer.py	2012-05-09 08:08:56 UTC (rev 2297)
+++ udd/udd/bibref_gatherer.py	2012-05-09 08:40:58 UTC (rev 2298)
@@ -35,6 +35,8 @@
   rm_f(basetexfile+'.blg')
   rm_f(basetexfile+'.log')
 
+# seek for authors separated by ',' rather than by ' and '
+seek_broken_authors_re = re.compile('^[^\s^,]+\s+[^\s^,]+\s*,\s*[^\s^,]+\s+[^\s^,]')
 
 def open_tex_process(texexe, basetexfile):
   if texexe == 'pdflatex':
@@ -143,6 +145,9 @@
             ref['value'] = new_author
           if ref['value'].count(',') > ref['value'].lower().count(' and ') + 1:
             self.log.warning("Suspicious authors field in source package %s with way more ',' than ' and ' strings: %s", source, ref['value'])
+          match = seek_broken_authors_re.search(ref['value'])
+          if match:
+            self.log.warning("Suspicious authors field in source package %s - seems to have comma separated authors: %s", source, ref['value'])
       self.bibrefs.append(ref)
       if r.lower() == 'year':
         year = ref['value']




More information about the Collab-qa-commits mailing list