242
242
log.error("Failed to install plug-in.")
243
243
except ImportError:
244
244
log.warn("Import error\n")
247
def close_running_hp_processes():
248
# check systray is running?
249
status,output = utils.Is_Process_Running('hp-systray')
251
ok,choice = tui.enter_choice("\nSome HPLIP applications are running. Press 'y' to close applications or press 'n' to quit upgrade(y=yes*, n=no):",['y','n'],'y')
252
if not ok or choice =='n':
253
log.info("Manually close HPLIP applications and run hp-upgrade again.")
258
from dbus import SystemBus, lowlevel
260
log.error("Unable to load DBus.")
264
args = ['', '', EVENT_SYSTEMTRAY_EXIT, prop.username, 0, '', '']
265
msg = lowlevel.SignalMessage('/', 'com.hplip.StatusService', 'Event')
266
msg.append(signature='ssisiss', *args)
267
log.debug("Sending close message to hp-systray ...")
268
SystemBus().send_message(msg)
271
log.error("Failed to send DBus message to hp-systray/hp-toolbox.")
274
toolbox_status,output = utils.Is_Process_Running('hp-toolbox')
276
if toolbox_status is True:
277
log.error("Failed to close either HP-Toolbox/HP-Systray. Manually close and run hp-upgrade again.")