reformat main
This commit is contained in:
parent
6f9eda3c3a
commit
089e892e12
|
@ -10,14 +10,18 @@ from .importer import import_note_type
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print("No action provided.\n")
|
return print(
|
||||||
print(f"import\tAdd one of the available note types to Anki.")
|
"No action provided.\n\n"
|
||||||
print(f"export\tSave your note type as a template.")
|
f"import\tAdd one of the available note types to Anki.\n"
|
||||||
elif (cmd := sys.argv[1]) == 'export':
|
f"export\tSave your note type as a template.\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
match sys.argv[1]:
|
||||||
|
case 'export':
|
||||||
export_note_type()
|
export_note_type()
|
||||||
elif cmd == 'import':
|
case 'import':
|
||||||
import_note_type()
|
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.")
|
||||||
|
|
Loading…
Reference in a new issue