1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-05 21:34:16 +01:00

Merged with r235 of experimental-rworkman.

This commit is contained in:
Andrew Psaltis
2009-01-06 19:04:12 -05:00
2 changed files with 16 additions and 8 deletions

View File

@@ -49,4 +49,3 @@ case $1 in
;;
esac

View File

@@ -189,13 +189,22 @@ class configure(Command):
else:
self.kdedir = kdedir_candidate + '/share/autostart'
except (OSError, ValueError):
# If kde-config isn't present or returns an error, then we can
# assume that kde isn't installed on the user's system
self.no_install_kde = True
# If it turns out that the assumption above is wrong, then we'll
# do this instead:
#pass # use our default
# If kde-config isn't present, we'll check for kde-4.x
try:
kde4temp = subprocess.Popen(["kde4-config","--prefix"], stdout=subprocess.PIPE)
returncode = kde4temp.wait() # let it finish, and get the exit code
kde4dir_candidate = kde4temp.stdout.readline().strip() # read stdout
if len(kde4dir_candidate) == 0 or returncode != 0 or not os.path.isabs(kde4dir_candidate):
raise ValueError
else:
self.kdedir = kde4dir_candidate + '/share/autostart'
except (OSError, ValueError):
# If neither kde-config nor kde4-config are not present or
# return an error, then we can assume that kde isn't installed
# on the user's system
self.no_install_kde = True
# If the assumption above turns out to be wrong, do this:
#pass # use our default
self.python = '/usr/bin/python'
self.pidfile = '/var/run/wicd/wicd.pid'