Skip to content

Commit

Permalink
Merge pull request #1101 from stevenhua0320/lint-check-23
Browse files Browse the repository at this point in the history
Fix W605 F841 for publistbuilder.py and stylers.py
  • Loading branch information
sbillinge authored Jul 9, 2024
2 parents 5b29112 + 7c165e0 commit 5f1b1f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions regolith/builders/publistbuilder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Builder for publication lists."""

import os

try:
from bibtexparser.bwriter import BibTexWriter
Expand Down Expand Up @@ -44,7 +43,6 @@ def construct_global_ctx(self):
gtx["all_docs_from_collection"] = all_docs_from_collection

def latex(self):
fd = gr = kw = False
facility = None
filestub, qualifiers = "", ""
if self.rc.from_date:
Expand All @@ -60,7 +58,6 @@ def latex(self):
else:
from_date, to_date = None, None
if self.rc.grants:
gr = True
grants = self.rc.grants
if isinstance(grants, str):
grants = [grants]
Expand All @@ -73,13 +70,12 @@ def latex(self):
elif len(grants) == 1:
text_grants = grants[0]
pl = ""
cat_grants, all_grants = "", ""
cat_grants = ""
for g in grants:
cat_grants = cat_grants + "_" + g
filestub = f"{filestub}{cat_grants}"
qualifiers = f"{qualifiers} from Grant{pl} {text_grants}"
if self.rc.kwargs:
kw = True
key, value = self.rc.kwargs[0].split(":", 1)
if key == "facility":
facility = value
Expand Down
4 changes: 2 additions & 2 deletions regolith/stylers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def sentencecase(sentence):
-----
tbd or n/a are returned lower case, not sentence case.
"""
freezecaps = re.findall("\{[^{}]+\}", sentence)
freezecaps = re.findall("\\{[^{}]+\\}", sentence)
datalow = sentence.capitalize()
sentencecase = re.split("\{[^{}]+\}", datalow)
sentencecase = re.split("\\{[^{}]+\\}", datalow)
title = ""
freezecaps.reverse()
for word in sentencecase:
Expand Down

0 comments on commit 5f1b1f7

Please sign in to comment.