diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba0430d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ \ No newline at end of file diff --git a/MainGUI.py b/MainGUI.py index ea96113..8ca58d3 100644 --- a/MainGUI.py +++ b/MainGUI.py @@ -6,6 +6,7 @@ from functools import partial from tkinter import messagebox import os.path +import webbrowser class MainGUI: @@ -55,14 +56,19 @@ def pick_file(self): self.__file_path.set(path) # Uses convert_to_html function to convert the file chosen, - # the resets the GUI. If no file has been chosen, do nothing. + # then resets the GUI. If no file has been chosen, do nothing. def convert(self): path = self.__file_path.get() + target_file = "" if(path): #If a file has been chosen, then attempt convertion - self.convert_to_html(path) - messagebox.showinfo("Success", "You HTML has been successfully generated") + target_file = self.convert_to_html(path) + + if(target_file): # If the HTML is generated successfuly + messagebox.showinfo("Success", "Your HTML has been generated at: \n" + target_file) self.reset() + else: + messagebox.showerror("Error", "Something went wrong and the file could not be generated") # Resets the GUI to its original state. def reset(self): diff --git a/usfm2html.py b/usfm2html.py index 480fe24..8c15496 100755 --- a/usfm2html.py +++ b/usfm2html.py @@ -137,6 +137,9 @@ def convert_to_html(convert_file): newfile.write("") newfile.close() + return target_file + + arguments=sys.argv[1:] count_args=len(arguments) print("usfm2html: Making your output prettier since 2018\n")