qvm-toos: import dbus only when needed
Void import errors when 'dbus' module not really needed.
This commit is contained in:
parent
d88da1e66b
commit
4300d778a5
@ -20,7 +20,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
import dbus
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
system_bus = None
|
system_bus = None
|
||||||
@ -29,6 +28,7 @@ session_bus = None
|
|||||||
notify_object = None
|
notify_object = None
|
||||||
|
|
||||||
def tray_notify_init():
|
def tray_notify_init():
|
||||||
|
import dbus
|
||||||
global notify_object
|
global notify_object
|
||||||
try:
|
try:
|
||||||
notify_object = dbus.SessionBus().get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
|
notify_object = dbus.SessionBus().get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
|
||||||
@ -51,6 +51,7 @@ def tray_notify_error(msg, timeout = 3000):
|
|||||||
def notify_error_qubes_manager(name, message):
|
def notify_error_qubes_manager(name, message):
|
||||||
global system_bus
|
global system_bus
|
||||||
if system_bus is None:
|
if system_bus is None:
|
||||||
|
import dbus
|
||||||
system_bus = dbus.SystemBus()
|
system_bus = dbus.SystemBus()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -64,6 +65,7 @@ def notify_error_qubes_manager(name, message):
|
|||||||
def clear_error_qubes_manager(name, message):
|
def clear_error_qubes_manager(name, message):
|
||||||
global system_bus
|
global system_bus
|
||||||
if system_bus is None:
|
if system_bus is None:
|
||||||
|
import dbus
|
||||||
system_bus = dbus.SystemBus()
|
system_bus = dbus.SystemBus()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user