Fixed file open problem
This commit is contained in:
parent
2ddfe0a07d
commit
aa984b6be4
@ -35,16 +35,16 @@ class Launcher:
|
|||||||
else:
|
else:
|
||||||
command = ["xdg-open", file]
|
command = ["xdg-open", file]
|
||||||
|
|
||||||
self.execute(command)
|
self.execute(command, use_shell=False)
|
||||||
|
|
||||||
|
|
||||||
def execute(self, command, start_dir=os.getenv("HOME"), use_os_system=None):
|
def execute(self, command, start_dir=os.getenv("HOME"), use_os_system=None, use_shell=True):
|
||||||
self.logger.debug(command)
|
self.logger.debug(command)
|
||||||
if use_os_system:
|
if use_os_system:
|
||||||
os.system(command)
|
os.system(command)
|
||||||
else:
|
else:
|
||||||
DEVNULL = open(os.devnull, 'w')
|
DEVNULL = open(os.devnull, 'w')
|
||||||
subprocess.Popen(command, cwd=start_dir, shell=True, start_new_session=True, stdout=DEVNULL, stderr=DEVNULL, close_fds=True)
|
subprocess.Popen(command, cwd=start_dir, shell=use_shell, start_new_session=True, stdout=DEVNULL, stderr=DEVNULL, close_fds=True)
|
||||||
|
|
||||||
|
|
||||||
def remux_video(self, hash, file):
|
def remux_video(self, hash, file):
|
||||||
|
@ -110,7 +110,7 @@ class WindowMixin(TabMixin):
|
|||||||
|
|
||||||
fileName = model[item][1]
|
fileName = model[item][1]
|
||||||
dir = view.get_current_directory()
|
dir = view.get_current_directory()
|
||||||
file = dir + "/" + fileName
|
file = f"{dir}/{fileName}"
|
||||||
|
|
||||||
if isdir(file):
|
if isdir(file):
|
||||||
view.set_path(file)
|
view.set_path(file)
|
||||||
@ -120,7 +120,7 @@ class WindowMixin(TabMixin):
|
|||||||
self.set_file_watcher(view)
|
self.set_file_watcher(view)
|
||||||
self.set_bottom_labels(view)
|
self.set_bottom_labels(view)
|
||||||
else:
|
else:
|
||||||
view.open_file_locally(file)
|
self.open_files()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.display_message(self.error, f"{repr(e)}")
|
self.display_message(self.error, f"{repr(e)}")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user