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
|
return None
|
||||||
|
|
||||||
def exec_command(executable=None, *parameters):
|
def exec_command(executable, *parameters):
|
||||||
import os
|
import os
|
||||||
|
command = [executable]
|
||||||
|
command.extend(parameters)
|
||||||
if windows_check():
|
if windows_check():
|
||||||
try:
|
try:
|
||||||
os.startfile(parameters)
|
from subprocess import Popen
|
||||||
|
Popen(command)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
command = [executable]
|
|
||||||
command.extend(parameters)
|
|
||||||
try:
|
try:
|
||||||
os.WEXITSTATUS(os.system(command[0] + " \"%s\"" %command[1]))
|
os.WEXITSTATUS(os.system(command[0] + " \"%s\"" %command[1]))
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|||||||
@ -739,9 +739,9 @@ window, please enter your password"))
|
|||||||
torrent_path = self.manager.get_torrent_path(uid)
|
torrent_path = self.manager.get_torrent_path(uid)
|
||||||
if not common.windows_check():
|
if not common.windows_check():
|
||||||
file_manager = "xdg-open"
|
file_manager = "xdg-open"
|
||||||
common.exec_command(file_manager, torrent_path)
|
|
||||||
else:
|
else:
|
||||||
common.exec_command(executable=None, parameters=torrent_path)
|
file_namager = "explorer.exe"
|
||||||
|
common.exec_command(file_manager, torrent_path)
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user