[GRASS-SVN] r73092 - sandbox/wenzeslaus/g.citation

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 13 19:37:14 PDT 2018


Author: wenzeslaus
Date: 2018-08-13 19:37:13 -0700 (Mon, 13 Aug 2018)
New Revision: 73092

Modified:
   sandbox/wenzeslaus/g.citation/g.citation.py
Log:
g.citation: split author name record using and (around 10 modules)

Modified: sandbox/wenzeslaus/g.citation/g.citation.py
===================================================================
--- sandbox/wenzeslaus/g.citation/g.citation.py	2018-08-14 00:59:58 UTC (rev 73091)
+++ sandbox/wenzeslaus/g.citation/g.citation.py	2018-08-14 02:37:13 UTC (rev 73092)
@@ -333,9 +333,17 @@
             feature = feature_heading
         # TODO: handles two authors at the same line
         # TODO: handle "unknown" author
-        authors.append({'name': name, 'institute': institute,
-                        'feature': feature, 'email': email,
-                        'orcid': orcid})
+        if " and " in name:
+            names = name.split(" and ", 1)
+            # assuming that names with "and" won't be at the same
+            # line/record with author unique info like email or orcid
+        else:
+            names = [name]
+        for name in names:
+            authors.append({
+                'name': name, 'institute': institute,
+                'feature': feature, 'email': email,
+                'orcid': orcid})
     return authors
 
 



More information about the grass-commit mailing list