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:
23
setup.py
23
setup.py
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user