diff --git a/royalnet/alchemist/func.py b/royalnet/alchemist/func.py index 9038b63d..0afa985f 100644 --- a/royalnet/alchemist/func.py +++ b/royalnet/alchemist/func.py @@ -1,4 +1,3 @@ -from ..typing import * import sqlalchemy diff --git a/royalnet/alchemist/make.py b/royalnet/alchemist/make.py index e975ea44..a930e41c 100644 --- a/royalnet/alchemist/make.py +++ b/royalnet/alchemist/make.py @@ -13,7 +13,13 @@ class Makeable: @classmethod def make(cls: Type[T], session: o.session.Session, **kwargs) -> T: - """Find the item with the specified name, or create it if it doesn't exist.""" + """ + Find the item with the specified name, or create it if it doesn't exist. + + :param session: The session to be used in the query and creation. + :param kwargs: Arguments to use in the filter_by clause and in the item constructor. + :return: The retrieved or created item. + """ # Find the item item = session.query(cls).filter_by(**kwargs).one_or_none() # Create the item @@ -25,7 +31,12 @@ class Makeable: @classmethod def unmake(cls: Type[T], session: o.session.Session, **kwargs) -> None: - """Find the item with the specified name, and delete it if it exists.""" + """ + Find the item with the specified name, and delete it if it exists. + + :param session: The session to be used in the query and creation. + :param kwargs: Arguments to use in the filter_by clause and in the item constructor. + """ # Find the item item = session.query(cls).filter_by(**kwargs).one_or_none() # Delete the item diff --git a/royalnet/alchemist/repr.py b/royalnet/alchemist/repr.py index f6688ac0..d2ca235c 100644 --- a/royalnet/alchemist/repr.py +++ b/royalnet/alchemist/repr.py @@ -1,5 +1,7 @@ class ColRepr: - """A mixin that can be added to a declared class to display all table columns in the __repr__.""" + """ + A mixin that can be added to a declared class to display all table columns in the __repr__. + """ def __repr__(self): columns = [c.name for c in self.__class__.__table__.columns] diff --git a/royalnet/campaigns/exc.py b/royalnet/campaigns/exc.py index d036e2ac..2e1a0af0 100644 --- a/royalnet/campaigns/exc.py +++ b/royalnet/campaigns/exc.py @@ -1,4 +1,4 @@ -from ..errors import RoyalnetException +from ..exc import RoyalnetException class CampaignsError(RoyalnetException): diff --git a/royalnet/errors.py b/royalnet/exc.py similarity index 100% rename from royalnet/errors.py rename to royalnet/exc.py diff --git a/royalnet/scrolls/__init__.py b/royalnet/scrolls/__init__.py index 332e83e3..1764ee8e 100644 --- a/royalnet/scrolls/__init__.py +++ b/royalnet/scrolls/__init__.py @@ -1,6 +1,5 @@ from royalnet.typing import * import os -import json import re import toml import json @@ -36,7 +35,7 @@ class Scroll: @classmethod def from_file(cls, namespace: str, file_path: os.PathLike): - file, ext = os.path.splitext(file_path) + _, ext = os.path.splitext(file_path) lext = ext.lower() with open(file_path) as file: diff --git a/royalnet/scrolls/exc.py b/royalnet/scrolls/exc.py index 10f91fb3..aed0228a 100644 --- a/royalnet/scrolls/exc.py +++ b/royalnet/scrolls/exc.py @@ -1,4 +1,4 @@ -from ..errors import RoyalnetException +from ..exc import RoyalnetException class ScrollsException(RoyalnetException):