Skip to content

Commit

Permalink
Merge pull request #6 from Zhou-Shilin/main
Browse files Browse the repository at this point in the history
Fix: Ask user to retype the version number if it's invalid
  • Loading branch information
Zhou-Shilin authored May 11, 2024
2 parents ae9d7bd + 893e6a4 commit 61c014b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import tkinter as tk
import tkinter.messagebox as msgbox
import tkinter.simpledialog as simpledialog

from log_writer import logger
import core
Expand Down Expand Up @@ -83,8 +84,8 @@ def generate_schematic():

while version_tag is None:
msgbox.showerror("Error", "Invalid version number. Please retype the version number.")
version = version_entry.get()
version_tag = core.input_version_to_mcs_tag(version)
version = simpledialog.askstring("Reinput", "Please retype the version number (eg. 1.20.1): ")
core.input_version_to_mcs_tag(version)

schem.save("generated", name, version_tag)

Expand Down Expand Up @@ -127,4 +128,5 @@ def Application():
core.initialize()
Application()
else:
print("Error: Please run ui.py as the main program instead of importing it from another program.")
print("Error: Please run ui.py as the main program instead of importing it from another program.")
logger("Exit: Running ui.py as an imported module.")

0 comments on commit 61c014b

Please sign in to comment.