Added nm-mock, a fake NetworkManager.
[cnetworkmanager.git] / networkmanager / base.py
blobf0730e3861e9fa0b618570703909cac95d082221
1 import dbus
2 from dbusclient import DBusClient
4 """The bus where NetworkManager objects live.
6 It can be globally changed to a debugging bus for a mock NM service.
7 Having that as a parameter would complicate the API for the normal
8 use case, so it is factored out here.
9 """
10 NM_BUS = dbus.SystemBus()
11 #print "Global Bus:", NM_BUS
12 def Bus():
13 # print "Bus:", NM_BUS
14 return NM_BUS
16 class Base(DBusClient):
17 def __init__(self, bus_name=None, object_path=None, introspect=True, follow_name_owner_changes=False, **kwargs):
18 conn = Bus()
19 super(Base, self).__init__(conn, bus_name, object_path, introspect, follow_name_owner_changes, **kwargs)