diff -ur hplip-3.9.2.orig/ui4/devmgr5.py hplip-3.9.2/ui4/devmgr5.py --- hplip-3.9.2.orig/ui4/devmgr5.py 2009-02-20 01:36:38.000000000 +0100 +++ hplip-3.9.2/ui4/devmgr5.py 2009-03-17 20:10:53.000000000 +0100 @@ -127,20 +127,10 @@ install_plugin = (i == QMessageBox.Yes) if install_plugin: - su_sudo_str = su_sudo() - if su_sudo_str is None: - QMessageBox.critical(self.parent, - self.parent.windowTitle(), - self.__tr("<b>Unable to find an appropriate su/sudo utility to run hp-plugin.</b>"), - QMessageBox.Ok, - QMessageBox.NoButton, - QMessageBox.NoButton) - - else: if utils.which('hp-plugin'): - cmd = su_sudo_str % 'hp-plugin' + cmd = 'hp-plugin' else: - cmd = su_sudo_str % 'python ./plugin.py' + cmd = 'python ./plugin.py' log.debug(cmd) utils.run(cmd, log_output=True, password_func=None, timeout=1) @@ -1957,20 +1947,10 @@ # *********************************************************************************** def SetupDeviceAction_activated(self): - su_sudo_str = su_sudo() - if su_sudo_str is None: - QMessageBox.critical(self, - self.windowTitle(), - self.__tr("<b>Unable to find an appropriate su/sudo utility to run hp-setup.</b>"), - QMessageBox.Ok, - QMessageBox.NoButton, - QMessageBox.NoButton) - - else: if utils.which('hp-setup'): - cmd = su_sudo_str % 'hp-setup -u' + cmd = 'hp-setup -u' else: - cmd = su_sudo_str % 'python ./setup.py -u' + cmd = 'python ./setup.py -u' log.debug(cmd) utils.run(cmd, log_output=True, password_func=None, timeout=1) Only in hplip-3.9.2/ui4: devmgr5.py~ diff -ur hplip-3.9.2.orig/ui4/nodevicesdialog.py hplip-3.9.2/ui4/nodevicesdialog.py --- hplip-3.9.2.orig/ui4/nodevicesdialog.py 2009-02-20 01:36:38.000000000 +0100 +++ hplip-3.9.2/ui4/nodevicesdialog.py 2009-03-17 20:40:38.000000000 +0100 @@ -49,44 +49,24 @@ def SetupButton_clicked(self): self.close() - su_sudo = None - - if utils.which('kdesu'): - su_sudo = 'kdesu -- %s' - - elif utils.which('gnomesu'): - su_sudo = 'gnomesu -c "%s"' + if utils.which('hp-setup'): + cmd = 'hp-setup -u' + else: + cmd = 'python ./setup.py -u' - elif utils.which('gksu'): - su_sudo = 'gksu "%s"' + log.debug(cmd) + utils.run(cmd, log_output=True, password_func=None, timeout=1) - if su_sudo is None: + try: + self.parent().rescanDevices() + except Error: QMessageBox.critical(self, self.windowTitle(), - self.__tr("<b>Unable to find an appropriate su/sudo utility to run hp-setup.</b>"), + self.__tr("<b>An error occurred.</b><p>Please re-start the Device Manager and try again."), QMessageBox.Ok, QMessageBox.NoButton, QMessageBox.NoButton) - else: - if utils.which('hp-setup'): - cmd = su_sudo % 'hp-setup -u' - else: - cmd = su_sudo % 'python ./setup.py -u' - - log.debug(cmd) - utils.run(cmd, log_output=True, password_func=None, timeout=1) - - try: - self.parent().rescanDevices() - except Error: - QMessageBox.critical(self, - self.windowTitle(), - self.__tr("<b>An error occurred.</b><p>Please re-start the Device Manager and try again."), - QMessageBox.Ok, - QMessageBox.NoButton, - QMessageBox.NoButton) - def CUPSButton_clicked(self): self.close() Only in hplip-3.9.2/ui4: nodevicesdialog.py~