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 E231 E501 F541 issues. #1089

Merged
merged 1 commit into from
Jul 5, 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
19 changes: 11 additions & 8 deletions regolith/helpers/l_progressreporthelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def subparser(subpi):
nargs="+",
choices=PROJECTUM_STATI,
help=f"Filter projecta for these stati."
f" Default is {*(PROJECTUM_ACTIVE_STATI+PROJECTUM_FINISHED_STATI),}",
f" Default is {*(PROJECTUM_ACTIVE_STATI+PROJECTUM_FINISHED_STATI), }",
default=PROJECTUM_ACTIVE_STATI + PROJECTUM_FINISHED_STATI,
**listbox_kwargs,
)
Expand Down Expand Up @@ -92,7 +92,8 @@ def print_projectum(self, selected_projecta):
print(f"{p.get('_id')}")
if p.get("deliverable"):
print(
f" status: {p.get('status')}, begin_date: {p.get('begin_date')}, due_date: {p.get('deliverable').get('due_date')}"
f" status: {p.get('status')}, begin_date: {p.get('begin_date')}, "
f"due_date: {p.get('deliverable').get('due_date')}"
)
if p.get("status") == "finished":
print(f" finished: {p.get('end_date')}")
Expand Down Expand Up @@ -128,7 +129,8 @@ def print_projectum(self, selected_projecta):
print(f"{p.get('_id')}")
if p.get("deliverable"):
print(
f" status: {p.get('status')}, begin_date: {p.get('begin_date')}, due_date: {p.get('deliverable').get('due_date')}"
f" status: {p.get('status')}, begin_date: {p.get('begin_date')}, "
f"due_date: {p.get('deliverable').get('due_date')}"
)
print(f" description: {p.get('description')}")
if p.get("status") == "finished":
Expand All @@ -139,7 +141,8 @@ def print_projectum(self, selected_projecta):
print(" milestones:")
for m in p.get("milestones"):
print(
f" due: {m.get('due_date')}, {m.get('name')}, type: {m.get('type')}, status: {m.get('status')}"
f" due: {m.get('due_date')}, {m.get('name')}, "
f"type: {m.get('type')}, status: {m.get('status')}"
)
print(f" objective: {m.get('objective')}")

Expand Down Expand Up @@ -173,15 +176,15 @@ def sout(self):
startedp.append(prum)
else:
otherp.append(prum)
print(f"*************************[Orphan Projecta]*************************")
print("*************************[Orphan Projecta]*************************")
for prum in otherp:
print(f"{prum.get('_id')}, status: {prum.get('status')}")
print(f"*************************[Finished Projecta]*************************")
print("*************************[Finished Projecta]*************************")
for prum in finishedp:
print(f"{prum.get('_id')}, grant: {prum.get('grants')}")
print(f" description: {prum.get('description')}")
print(f" finished: {prum.get('end_date')}")
print(f"*************************[Proposed Projecta]*************************")
print("*************************[Proposed Projecta]*************************")
self.print_projectum(proposedp)
print(f"*************************[In Progress Projecta]*************************")
print("*************************[In Progress Projecta]*************************")
self.print_projectum(startedp)
15 changes: 8 additions & 7 deletions regolith/helpers/l_projectahelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def subparser(subpi):
"-c",
"--current",
action="store_true",
help=f"Lists only active projecta. If not specified, will be active and paused but not cancelled",
help="Lists only active projecta. If not specified, will be active and paused but not cancelled",
)
subpi.add_argument("-v", "--verbose", action="store_true", help="increase verbosity of output")
subpi.add_argument("--grp_by_lead", action="store_true", help="Lists all projecta by their lead")
Expand All @@ -57,7 +57,7 @@ def subparser(subpi):
"--all",
action="store_true",
help=f"Lists all projecta including those with statuses "
f"in {*PROJECTUM_CANCELLED_STATI,} that are excluded by default",
f"in {*PROJECTUM_CANCELLED_STATI, } that are excluded by default",
)
subpi.add_argument(
"-e",
Expand Down Expand Up @@ -158,7 +158,7 @@ def sout(self):
collection = [prum for prum in collection if rc.grant in prum.get("grants", [])]
if rc.orphans:
if rc.person or rc.lead:
raise RuntimeError(f"you cannot specify lead or person with orphans")
raise RuntimeError("you cannot specify lead or person with orphans")
dead_parents = [person.get("_id") for person in self.gtx["people"] if not person.get("active")]
collection = [
prum
Expand All @@ -169,11 +169,11 @@ def sout(self):
]
if rc.lead:
if rc.person or rc.orphans:
raise RuntimeError(f"please specify either lead or person, not both")
raise RuntimeError("please specify either lead or person, not both")
collection = [prum for prum in collection if prum.get("lead") == rc.lead]
if rc.person:
if rc.orphans:
raise RuntimeError(f"please specify either lead or person, not both")
raise RuntimeError("please specify either lead or person, not both")
if isinstance(rc.person, str):
rc.person = [rc.person]
collection = [
Expand Down Expand Up @@ -220,10 +220,11 @@ def sout(self):
if p.get("status") == "finished":
ended = f", end_date: {p.get('end_date')}"
else:
ended = f""
ended = ""
print(p.get("_id"))
print(
f" status: {p.get('status')}, begin_date: {p.get('begin_date')}, due_date: {p.get('deliverable', {}).get('due_date')}{ended}, grant: {grants}"
f" status: {p.get('status')}, begin_date: {p.get('begin_date')}, "
f"due_date: {p.get('deliverable', {}).get('due_date')}{ended}, grant: {grants}"
)
print(f" description: {p.get('description')}")
print(" team:")
Expand Down
3 changes: 2 additions & 1 deletion regolith/helpers/reimbstatushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def sout(self):
print(
f" Requested: {unseg}, "
f"Reimbursed: {j.get('amount')}, Date: "
f"{reimb_dates.get('date',dt.date(1900,1,1).isoformat())}, Grants: {grantstring}"
f"{reimb_dates.get('date', dt.date(1900, 1, 1).isoformat())}, "
f"Grants: {grantstring}"
)
print("\nSubmitted expenses:")
for i in sorted_sub:
Expand Down
Loading