run pyupgrade

This commit is contained in:
Ren Tatsumoto 2021-12-25 22:38:09 +03:00
parent 670986db1c
commit 6f9eda3c3a
3 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,8 @@ A collection of user-created note types for Anki 2.1. It includes a super user-f
## Usage ## Usage
Install [Python](https://wiki.archlinux.org/title/Python) 3.10 or later if you haven't already.
Clone the repository and `cd` into it. Clone the repository and `cd` into it.
If you have never cloned a repository before, If you have never cloned a repository before,
you need to install [git](https://git-scm.com/). you need to install [git](https://git-scm.com/).

View file

@ -34,7 +34,7 @@ def read_num(msg: str = "Input number: ", min_val: int = 0, max_val: int = None)
return resp return resp
def select(items: list[str], msg: str = "Select item number: ") -> Optional[str]: def select(items: list[str], msg: str = "Select item number: ") -> str | None:
if not items: if not items:
print("Nothing to show.") print("Nothing to show.")
return return

View file

@ -25,7 +25,7 @@ def read_card_templates(model_dir_name: str, template_names: list[str]) -> list[
def read_model(model_dir_name: str) -> NoteType: def read_model(model_dir_name: str) -> NoteType:
with open(os.path.join(NOTE_TYPES_DIR, model_dir_name, JSON_FILENAME), 'r') as f: with open(os.path.join(NOTE_TYPES_DIR, model_dir_name, JSON_FILENAME)) as f:
model_dict = json.load(f) model_dict = json.load(f)
return NoteType( return NoteType(