Skip to content

Commit

Permalink
minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
unaidedelf8777 committed Oct 15, 2023
1 parent 2d0e3fe commit 81d7a36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion interpreter/terminal_interface/components/file_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_path(self, type=None):
path = QFileDialog.getExistingDirectory(None, "Open Folder",
"", options=options)
else:
raise ValueError("Invalid type. Expected 'file', 'folder', or None.")
path = self.get_path(type=None) # this or val err, may aswell explicitly pass none.

return path

Expand Down
14 changes: 10 additions & 4 deletions interpreter/terminal_interface/magic_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ def is_gui_available():
try:
from PyQt5.QtWidgets import QApplication
app = QApplication([])
del app
return True
except Exception as e:
print(f"An error occurred: {str(e)}")
return False
return True


args = list(args)
if self.use_containers:
try:
client = docker.APIClient()
Expand All @@ -151,8 +153,12 @@ def is_gui_available():
if type is not None:
path = fd.get_path(type=type)
else:
path = fd.get_path()
args.append(path)
path = fd.get_path(type=None)
if path is not None: # if none, they exited

args.append(path)
else: # We shall now exit on them out of spite
return
except ImportError as e:
Print(f"Internal import error {e}")
return
Expand Down

0 comments on commit 81d7a36

Please sign in to comment.