fix opening folder/files in windows
This commit is contained in:
parent
c1d7f68c12
commit
3ba8ba710d
@ -185,16 +185,17 @@ def fetch_url(url):
|
||||
|
||||
return None
|
||||
|
||||
def exec_command(executable=None, *parameters):
|
||||
def exec_command(executable, *parameters):
|
||||
import os
|
||||
command = [executable]
|
||||
command.extend(parameters)
|
||||
if windows_check():
|
||||
try:
|
||||
os.startfile(parameters)
|
||||
from subprocess import Popen
|
||||
Popen(command)
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
command = [executable]
|
||||
command.extend(parameters)
|
||||
try:
|
||||
os.WEXITSTATUS(os.system(command[0] + " \"%s\"" %command[1]))
|
||||
except OSError:
|
||||
|
||||
@ -739,9 +739,9 @@ window, please enter your password"))
|
||||
torrent_path = self.manager.get_torrent_path(uid)
|
||||
if not common.windows_check():
|
||||
file_manager = "xdg-open"
|
||||
common.exec_command(file_manager, torrent_path)
|
||||
else:
|
||||
common.exec_command(executable=None, parameters=torrent_path)
|
||||
file_namager = "explorer.exe"
|
||||
common.exec_command(file_manager, torrent_path)
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user