Fix: Correct SyntaxError in gui.py
This commit is contained in:
25
gui.py
25
gui.py
@@ -168,31 +168,6 @@ class VideoConverterGUI:
|
|||||||
pass
|
pass
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
self.status_var.set("Converting video...")
|
|
||||||
success = converter.convert_video(input_path, output_dir, quality)
|
|
||||||
|
|
||||||
if success:
|
|
||||||
self.status_var.set("Conversion successful!")
|
|
||||||
messagebox.showinfo("Success", "Conversion completed successfully!")
|
|
||||||
else:
|
|
||||||
raise Exception("Conversion failed. Check logs for details.")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.status_var.set(f"Error: {e}")
|
|
||||||
try:
|
|
||||||
with open(config.FFMPEG_LOG_FILE_PATH, "r") as f:
|
|
||||||
log_lines = f.readlines()
|
|
||||||
last_10_lines = "".join(log_lines[-10:])
|
|
||||||
messagebox.showerror("Error", f"An error occurred: {e}\n\nLast 10 lines of log:\n{last_10_lines}")
|
|
||||||
except FileNotFoundError:
|
|
||||||
messagebox.showerror("Error", f"An error occurred: {e}\n\nCould not find log file.")
|
|
||||||
except Exception as log_e:
|
|
||||||
messagebox.showerror("Error", f"An error occurred: {e}\n\nCould not read log file: {log_e}")
|
|
||||||
|
|
||||||
finally:
|
|
||||||
self.convert_button.config(state=tk.NORMAL)
|
|
||||||
self.cancel_button.config(state=tk.DISABLED)
|
|
||||||
|
|
||||||
def cancel_conversion(self):
|
def cancel_conversion(self):
|
||||||
# This is a bit tricky, as we can't easily kill the thread.
|
# This is a bit tricky, as we can't easily kill the thread.
|
||||||
# For now, we'll just show a message.
|
# For now, we'll just show a message.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ a = Analysis(['main.py'],
|
|||||||
pathex=['/home/joe/Cloud9/Documents/Obisdian/projects/Video Converter'],
|
pathex=['/home/joe/Cloud9/Documents/Obisdian/projects/Video Converter'],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[],
|
datas=[],
|
||||||
hiddenimports=[],
|
hiddenimports=['gui'],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
|
|||||||
Reference in New Issue
Block a user