Skip to content

Commit

Permalink
assign default what
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Apr 21, 2024
1 parent 613c770 commit fb2e284
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions kitsunekko_tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ def config_locations():
)


def default_config_not_found_description() -> str:
with io.StringIO() as si:
si.write("Couldn't find config file. ")
si.write("Create the file in one of the following locations:\n")
si.write("\n".join(f"・ {location}" for location in config_locations()))
return si.getvalue()


@dataclasses.dataclass
class ConfigFileNotFoundError(KitsuException, FileNotFoundError):
@property
def what(self) -> str:
with io.StringIO() as si:
si.write("Couldn't find config file. ")
si.write("Create the file in one of the following locations:\n")
si.write("\n".join(f"・ {location}" for location in config_locations()))
return si.getvalue()
what: str = default_config_not_found_description()


@dataclasses.dataclass
Expand Down

0 comments on commit fb2e284

Please sign in to comment.