aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/transforms/csl.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat_tools/transforms/csl.py')
-rw-r--r--python/fatcat_tools/transforms/csl.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/python/fatcat_tools/transforms/csl.py b/python/fatcat_tools/transforms/csl.py
index 832ad6aa..ba199efb 100644
--- a/python/fatcat_tools/transforms/csl.py
+++ b/python/fatcat_tools/transforms/csl.py
@@ -1,6 +1,5 @@
import json
-import collections
from citeproc import CitationStylesStyle, CitationStylesBibliography
from citeproc import Citation, CitationItem
@@ -8,8 +7,6 @@ from citeproc import formatter
from citeproc.source.json import CiteProcJSON
from citeproc_styles import get_style_filepath
-from fatcat_openapi_client import ApiClient
-
def contribs_by_role(contribs, role):
ret = [c.copy() for c in contribs if c['role'] == role]
@@ -214,14 +211,13 @@ def citeproc_csl(csl_json, style, html=False):
lines = bib.bibliography()[0]
if style == "bibtex":
out = ""
- for l in lines:
- if l.startswith(" @"):
+ for line in lines:
+ if line.startswith(" @"):
out += "@"
- elif l.startswith(" "):
- out += "\n " + l
+ elif line.startswith(" "):
+ out += "\n " + line
else:
- out += l
+ out += line
return ''.join(out)
else:
return ''.join(lines)
-