reformat main

This commit is contained in:
Ren Tatsumoto 2021-12-25 22:51:39 +03:00
parent 6f9eda3c3a
commit 089e892e12

View file

@ -10,14 +10,18 @@ from .importer import import_note_type
def main():
try:
if len(sys.argv) < 2:
print("No action provided.\n")
print(f"import\tAdd one of the available note types to Anki.")
print(f"export\tSave your note type as a template.")
elif (cmd := sys.argv[1]) == 'export':
return print(
"No action provided.\n\n"
f"import\tAdd one of the available note types to Anki.\n"
f"export\tSave your note type as a template.\n"
)
try:
match sys.argv[1]:
case 'export':
export_note_type()
elif cmd == 'import':
case 'import':
import_note_type()
except URLError:
print("Couldn't connect. Make sure Anki is open and AnkiConnect is installed.")