From 3ba8ba710d120e41ce7bef35a6bbea51abc9841e Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 30 Apr 2008 23:33:38 +0000 Subject: [PATCH] fix opening folder/files in windows --- src/common.py | 9 +++++---- src/interface.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common.py b/src/common.py index 94f1e79b5..284e47e67 100644 --- a/src/common.py +++ b/src/common.py @@ -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: diff --git a/src/interface.py b/src/interface.py index 34d954762..f9a0c1264 100644 --- a/src/interface.py +++ b/src/interface.py @@ -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