Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix W605 F841 for publistbuilder.py and stylers.py #1101

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading