Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 33a10a9

Browse files
committed
still start if dbus not available
1 parent 302029d commit 33a10a9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

eduvpn/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
# SPDX-License-Identifier: GPL-3.0+
55

66
import logging
7-
import dbus.mainloop.glib
87
import gi
98
gi.require_version('Gtk', '3.0')
109
from gi.repository import GObject, Gtk, GLib
10+
from eduvpn.util import have_dbus
1111

1212

1313
def main():
1414
format_ = '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
1515
logging.basicConfig(level=logging.INFO, format=format_)
1616
GObject.threads_init()
17-
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
17+
18+
if have_dbus():
19+
import dbus.mainloop.glib
20+
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
1821

1922
# import this later so the logging is properly configured
2023
from eduvpn.ui import EduVpnApp

0 commit comments

Comments
 (0)