reformat main

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

View file

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