1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 21:08:06 +01:00

Added logic for kde4-config (kde4's equivalent to kde-config)

This commit is contained in:
Robby Workman
2009-01-05 23:12:49 -06:00
parent e00f80c757
commit bb8cfb2b9d

View File

@@ -189,14 +189,23 @@ class configure(Command):
else: else:
self.kdedir = kdedir_candidate + '/share/autostart' self.kdedir = kdedir_candidate + '/share/autostart'
except (OSError, ValueError): except (OSError, ValueError):
# If kde-config isn't present or returns an error, then we can # If kde-config isn't present, we'll check for kde-4.x
# assume that kde isn't installed on the user's system 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 self.no_install_kde = True
# If it turns out that the assumption above is wrong, then we'll # If the assumption above turns out to be wrong, do this:
# do this instead:
#pass # use our default #pass # use our default
self.python = '/usr/bin/python' self.python = '/usr/bin/python'
self.pidfile = '/var/run/wicd/wicd.pid' self.pidfile = '/var/run/wicd/wicd.pid'
self.initfilename = os.path.basename(self.initfile) self.initfilename = os.path.basename(self.initfile)