fix opening folder/files in windows

This commit is contained in:
Marcos Pinto 2008-04-30 23:33:38 +00:00
parent c1d7f68c12
commit 3ba8ba710d
2 changed files with 7 additions and 6 deletions

View file

@ -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:

View file

@ -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