1.1 --- a/desktop.py Mon Sep 26 12:09:52 2005 +0000
1.2 +++ b/desktop.py Tue Sep 27 09:52:50 2005 +0000
1.3 @@ -16,6 +16,7 @@
1.4 import os
1.5 import sys
1.6 import subprocess
1.7 +import commands
1.8
1.9 def get_desktop():
1.10
1.11 @@ -56,7 +57,8 @@
1.12
1.13 Suggested values for 'desktop' are "standard", "KDE", "GNOME", "Mac OS X",
1.14 "Windows" where "standard" employs a DESKTOP_LAUNCH environment variable to
1.15 - open the specified 'url'.
1.16 + open the specified 'url'. DESKTOP_LAUNCH should be a command, possibly
1.17 + followed by arguments, and must have any special characters shell-escaped.
1.18
1.19 The process identifier of the "opener" (ie. viewer, editor, browser or
1.20 program) associated with the 'url' is returned by this function. If the
1.21 @@ -70,9 +72,8 @@
1.22 # Start with desktops whose existence can be easily tested.
1.23
1.24 if (desktop is None or desktop == "standard") and is_standard():
1.25 - # NOTE: This may not handle sophisticated commands properly.
1.26 - cmd = os.environ["DESKTOP_LAUNCH"].split()
1.27 - cmd.append(url)
1.28 + arg = "".join([os.environ["DESKTOP_LAUNCH"], commands.mkarg(url)])
1.29 + return subprocess.Popen(arg, shell=1).pid
1.30
1.31 elif (desktop is None or desktop == "Windows") and detected == "Windows":
1.32 # NOTE: This returns None in current implementations.