Skip to content

Commit

Permalink
Merge pull request #1096 from stevenhua0320/lint-check-18
Browse files Browse the repository at this point in the history
Fix F401 F841 error for helper_connect_main.py, emailer.py, chained_db.py, commands.py, beamplanbuilder.py
  • Loading branch information
sbillinge authored Jul 8, 2024
2 parents 5d9308b + 4ccb6d5 commit 55c5fa7
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions regolith/builders/beamplanbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class BeamPlanBuilder(LatexBuilderBase):
"""
Build a file of experiment plans for the beamtime from database entries.
Build a file of experiment plans for the beamtime from database entries.
The report is in the '.tex' file. The template of the file is in the
'templates/beamplan.tex'. The data will be grouped
according to beamtime. Each beamtime will generate a file of the plans.
Expand Down
2 changes: 0 additions & 2 deletions regolith/chained_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def __setitem__(self, key, value):
if key not in self:
super().__setitem__(key, value)
else:
res = None
results = []
# Try to get all the data from all the mappings
for mapping in reversed(self.maps):
if key in mapping:
Expand Down
2 changes: 0 additions & 2 deletions regolith/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

def add_cmd(rc):
"""Adds documents to a collection in a database."""
db = rc.client[rc.db]
coll = db[rc.coll]
docs = [json.loads(doc) if isinstance(doc, string_types) else doc for doc in rc.documents]
rc.client.insert_many(rc.db, rc.coll, docs)

Expand Down
1 change: 0 additions & 1 deletion regolith/emailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def grade_email(rc):

def class_email(rc):
"""Sends an email to all students in the active classes."""
gradedir = os.path.join(rc.builddir, GradeReportBuilder.btype)
addresses = {x["_id"]: x["email"] for x in list(all_docs_from_collection(rc.client, "students"))}
messages = []
for course in all_docs_from_collection(rc.client, "courses"):
Expand Down
5 changes: 1 addition & 4 deletions regolith/helper_connect_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@

from regolith.database import connect

from regolith import commands, __version__
from regolith import storage
from regolith import __version__
from regolith.helper import HELPERS
from regolith.runcontrol import DEFAULT_RC, load_rcfile, filter_databases
from regolith.schemas import SCHEMAS
from regolith.tools import update_schemas
from regolith.commands import CONNECTED_COMMANDS

from gooey import Gooey, GooeyParser


NEED_RC = set(CONNECTED_COMMANDS.keys())
NEED_RC |= {"rc", "deploy", "store"}
Expand Down

0 comments on commit 55c5fa7

Please sign in to comment.