Implement project opening and drawing editor canvas
This commit is contained in:
19
cli_ui.py
19
cli_ui.py
@@ -119,22 +119,7 @@ def cli_main():
|
||||
|
||||
# open existing font project
|
||||
elif choice == 1:
|
||||
file_path = filedialog.askopenfilename(
|
||||
title="Open font project",
|
||||
filetypes=[("Font project (json)", "*.fontproj")]
|
||||
)
|
||||
|
||||
if file_path == "":
|
||||
print("\nCanceled.\n")
|
||||
continue
|
||||
|
||||
# save last path to cache
|
||||
with open("last_path_cache.txt", "w") as f:
|
||||
f.write(file_path)
|
||||
|
||||
with open(file_path, "r") as f:
|
||||
project_data = json.load(f)
|
||||
|
||||
pass
|
||||
|
||||
# open last project
|
||||
elif choice == 2:
|
||||
@@ -173,4 +158,4 @@ def cli_main():
|
||||
|
||||
key_tips()
|
||||
|
||||
return project_data, file_path
|
||||
return project_data, file_path
|
||||
|
||||
Reference in New Issue
Block a user