[GRASS-SVN] r73346 - sandbox/wenzeslaus/g.citation
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 16 08:19:19 PDT 2018
Author: wenzeslaus
Date: 2018-09-16 08:19:19 -0700 (Sun, 16 Sep 2018)
New Revision: 73346
Modified:
sandbox/wenzeslaus/g.citation/g.citation.py
Log:
g.citation: no dots possible in BibTeX key
Modified: sandbox/wenzeslaus/g.citation/g.citation.py
===================================================================
--- sandbox/wenzeslaus/g.citation/g.citation.py 2018-09-16 15:10:44 UTC (rev 73345)
+++ sandbox/wenzeslaus/g.citation/g.citation.py 2018-09-16 15:19:19 UTC (rev 73346)
@@ -375,6 +375,12 @@
raise RuntimeError("The text does not contain source code URLs")
+def remove_dots_from_module_name(name):
+ # TODO: make this an option or perhaps a flag to replace with nothing
+ # is sufficient to cover most needs
+ return name.replace('.', '_')
+
+
def internal_to_csl_json(citation):
"""Returns the JSON structure as objects (not as one string)"""
authors = []
@@ -602,7 +608,8 @@
"""
# TODO: make this an option to allow for software in case it is supported
entry_type = "misc"
- print("@", entry_type, "{", citation['module'], ",", sep="")
+ key = remove_dots_from_module_name(citation['module'])
+ print("@", entry_type, "{", key, ",", sep="")
print(" title = {{", "GRASS GIS: ", citation['module'], " module}},", sep="")
More information about the grass-commit
mailing list