def __init__(self, bus, filename): log.Loggable.__init__(self) Object.__init__(self, bus, DB_PATH) DBusDB.__init__(self) self.tube = bus self.info("Loading db from %r", filename) self.filename = filename
def __init__(self, am, path, display_name, parameters): Object.__init__(self, am.connection, path) self._am = am self._connection = dbus.ObjectPath('/') self._connection_status = Connection_Status_Disconnected self._connection_status_reason = Connection_Status_Reason_None_Specified self._connection_error = u'' self._connection_error_details = dbus.Dictionary({}, signature='sv') self._service = u'' self._display_name = display_name self._icon = u'bob.png' self._enabled = True self._nickname = u'Bob' self._parameters = parameters self._has_been_online = False self._connect_automatically = False self._normalized_name = u'bob' self._automatic_presence = dbus.Struct( (Connection_Presence_Type_Available, 'available', ''), signature='uss') self._current_presence = dbus.Struct( (Connection_Presence_Type_Offline, 'offline', ''), signature='uss') self._requested_presence = dbus.Struct( (Connection_Presence_Type_Offline, 'offline', ''), signature='uss') self._avatar = dbus.Struct( (dbus.ByteArray(''), 'image/png'), signature='ays') self._interfaces = [ACCOUNT_IFACE_AVATAR_IFACE,]
def __init__(self, am, path, display_name, parameters): Object.__init__(self, am.connection, path) self._am = am self._connection = dbus.ObjectPath('/') self._connection_status = Connection_Status_Disconnected self._connection_status_reason = Connection_Status_Reason_None_Specified self._connection_error = u'' self._connection_error_details = dbus.Dictionary({}, signature='sv') self._service = u'' self._display_name = display_name self._icon = u'bob.png' self._enabled = True self._nickname = u'Bob' self._parameters = parameters self._has_been_online = False self._connect_automatically = False self._normalized_name = u'bob' self._automatic_presence = dbus.Struct( (Connection_Presence_Type_Available, 'available', ''), signature='uss') self._current_presence = dbus.Struct( (Connection_Presence_Type_Offline, 'offline', ''), signature='uss') self._requested_presence = dbus.Struct( (Connection_Presence_Type_Offline, 'offline', ''), signature='uss') self._avatar = dbus.Struct((dbus.ByteArray(''), 'image/png'), signature='ays') self._interfaces = [ ACCOUNT_IFACE_AVATAR_IFACE, ]
def __init__(self, am, path, display_name, parameters): Object.__init__(self, am.connection, path) self._am = am self._display_name = display_name self._icon = u'bob.png' self._enabled = True self._nickname = u'Bob' self._parameters = parameters self._connect_automatically = True self._normalized_name = u'bob' self._automatic_presence = dbus.Struct( (Connection_Presence_Type_Available, 'available', ''), signature='uss') self._current_presence = dbus.Struct( (Connection_Presence_Type_Offline, 'offline', ''), signature='uss') self._requested_presence = dbus.Struct( (Connection_Presence_Type_Offline, 'offline', ''), signature='uss') self._avatar = dbus.Struct( (dbus.ByteArray(''), 'image/png'), signature='ays') self._connection_status = Connection_Status_Disconnected self._connection_path = dbus.ObjectPath('/') self._interfaces = [ACCOUNT_IFACE_AVATAR_IFACE,]
def __init__(self, manager): from SCRIBES.Globals import session_bus as session from SCRIBES.Globals import SCRIBES_SAVE_PROCESS_DBUS_PATH bus_name = BusName(dbus_service, bus=session) Object.__init__(self, bus_name, SCRIBES_SAVE_PROCESS_DBUS_PATH) self.__manager = manager manager.connect("is-ready", self.__is_ready_cb) manager.connect("saved-data", self.__saved_data_cb) manager.connect("error", self.__error_cb)
def __init__(self, bus, commands, winman): # type: (SessionBus, CommandRegistry, WindowManager) -> None """ @param bus: The connection on which to export this object. See the C{dbus.service.Object} documentation for details. """ Object.__init__(self, bus, '/com/ssokolow/QuickTile') self.commands = commands self.winman = winman
def __init__(self, manager): from SCRIBES.Globals import session_bus from dbus.exceptions import NameExistsException try: bus_name = BusName(DBUS_SERVICE, bus=session_bus, do_not_queue=True) Object.__init__(self, bus_name, DBUS_PATH) self.__manager = manager except NameExistsException: manager.quit()
def __init__(self, session_bus=None, object_path=None): if dbus: Object.__init__(self, session_bus, object_path) self.Version = __version__ self.factura = None self.Exception = self.Traceback = "" self.LanzarExcepciones = False self.printer = None self.log = StringIO()
def __init__(self, session_bus=None, object_path=None): if dbus: Object.__init__(self, session_bus, object_path) self.Version = __version__ self.factura = None self.Exception = self.Traceback = "" self.LanzarExcepciones = False self.factura = {} self.printer = None self.log = StringIO()
def __init__(self, manager): from SCRIBES.Globals import session_bus from dbus.exceptions import NameExistsException try: bus_name = BusName(indexer_dbus_service, bus=session_bus, do_not_queue=True) Object.__init__(self, bus_name, indexer_dbus_path) self.__manager = manager manager.connect("finished", self.__finished_cb) except NameExistsException: manager.quit()
def __init__(self, manager): from Globals import session_bus from dbus.exceptions import NameExistsException try: service_name = "net.sourceforge.Scribes" object_path = "/net/sourceforge/Scribes" bus_name = BusName(service_name, bus=session_bus, do_not_queue=True) Object.__init__(self, bus_name, object_path) self.__manager = manager except NameExistsException: print "ERROR! Another instances of Scribes is already running. Cannot run more than one instance of Scribes. Killing this instance!" manager.force_quit()
def __init__(self, bus=None): #: map from object path to Account self._valid_accounts = {} #: map from object path to Account self._invalid_accounts = {} if bus is None: bus = dbus.SessionBus() ret = bus.request_name(AM_BUS_NAME, NAME_FLAG_DO_NOT_QUEUE) if ret == REQUEST_NAME_REPLY_EXISTS: raise dbus.NameExistsException(AM_BUS_NAME) Object.__init__(self, bus, AM_OBJECT_PATH)
def __init__(self, service): self.svc = service path = DBUS_PATH(service.get_name(), self.dbus_path) ns = DBUS_NS(service.get_name(), self.dbus_path) self.dbus_ns = ns self.dbus_path = path Object.__init__(self, BUS_NAME, path) self.config_match = BUS.add_signal_receiver( self.on_config_changed, 'CONFIG_CHANGED', ns, None, path, sender_keyword='sender') self.config_extra_match = BUS.add_signal_receiver( self.on_config_changed_extra, 'CONFIG_EXTRA_CHANGED', ns, None, path, sender_keyword='sender')
def __init__(self, am, path, display_name, parameters): Object.__init__(self, am.connection, path) self._am = am self._display_name = display_name self._icon = u"bob.png" self._enabled = True self._nickname = u"Bob" self._parameters = parameters self._connect_automatically = True self._normalized_name = u"bob" self._automatic_presence = dbus.Struct((Connection_Presence_Type_Available, "available", ""), signature="uss") self._current_presence = dbus.Struct((Connection_Presence_Type_Offline, "offline", ""), signature="uss") self._requested_presence = dbus.Struct((Connection_Presence_Type_Offline, "offline", ""), signature="uss") self._avatar = dbus.Struct((dbus.ByteArray(""), "image/png"), signature="ays") self._interfaces = [ACCOUNT_IFACE_AVATAR_IFACE]
def __init__(self, conn=None, object_path=None, bus_name=None, idle=None, enforce=True): """ Fire up this service as well as all of the paths for individual jobs. """ DBusObject.__init__(self, conn, object_path, bus_name) self.idle = idle self.policy = Policy(enforce) self.proxy = ServiceProxy() self.jobs = [] allsvcs = self.proxy.get_all_services() for job in allsvcs: self.jobs.append(SingleJobService(conn, '/'.join((DBUS_PATH, dbus_safe_name(job))), name=job, root=self )) log.info('Ready')
def __init__(self, service): self.svc = service path = DBUS_PATH(service.get_name()) ns = DBUS_NS(service.get_name()) self.dbus_ns = ns Object.__init__(self, BUS_NAME, path)
def __init__(self, tboplayer_instance): self.tboplayer_instance = tboplayer_instance dbus_loop = DBusGMainLoop(set_as_default=True) bus_name = dbus.service.BusName( TBOPLAYER_DBUS_OBJECT, bus=dbus.SessionBus(mainloop=dbus_loop)) Object.__init__(self, bus_name, TBOPLAYER_DBUS_PATH)
def __init__(self, bus): Object.__init__(self, bus, '/bz/UFWProfiles')
def __init__(self, manager): from SCRIBES.Globals import session_bus bus_name = BusName(indexer_dbus_service, bus=session_bus) Object.__init__(self, bus_name, indexer_dbus_path) self.__manager = manager manager.connect("finished", self.__finished_cb)
def __init__(self, conn, object_path='/'): Object.__init__(self, conn, object_path)
def __init__(self, bluemindo, bus): self.bluemindo = bluemindo dbusobj.__init__(self, bus, '/org/mpris/MediaPlayer2') self.properties = [ # Main 'CanQuit', # Player 'CanControl', 'CanPause', 'CanPlay', 'CanSeek', 'CanGoNext', 'CanGoPrevious', 'LoopStatus', 'PlaybackStatus', 'Metadata' ] self.playing = 'Stopped' self.song = None self.widgets = None def update_data(song): self.song = song self.playing = 'Playing' self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus', 'Metadata']) def play_pressed(): if self.playing == 'Playing': self.playing = 'Paused' elif self.playing == 'Paused': self.playing = 'Playing' elif self.playing == 'Stopped': self.playing = 'Playing' self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus']) def stop_pressed(): self.playing = 'Stopped' self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus']) def prevnext_pressed(): self.playing = 'Playing' self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus']) def bluemindo_started(widgets): self.widgets = widgets self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus']) self.launch_dbus_signal(INTERFACE_NAME, ['CanQuit']) extensions.connect('HasStartedSong', update_data) extensions.connect('OnPlayPressed', play_pressed) extensions.connect('OnStopPressed', stop_pressed) extensions.connect('OnAbortPlayback', stop_pressed) extensions.connect('OnPreviousPressed', prevnext_pressed) extensions.connect('OnNextPressed', prevnext_pressed) extensions.connect('OnBluemindoStarted', bluemindo_started)
def __init__(self, bus: SessionBus, commands: CommandRegistry, winman: WindowManager) -> None: Object.__init__(self, bus, '/com/ssokolow/QuickTile') self.commands = commands self.winman = winman
def __init__(self, processor): from Globals import session_bus as session bus_name = BusName(dbus_service, bus=session) Object.__init__(self, bus_name, dbus_path) self.__processor = processor
def __init__( self, wind_obj ): self.wind_obj = wind_obj self.bus_name = BusName( SERVICE_NAME, bus=SessionBus() ) dbusServiceObject.__init__( self, self.bus_name, '/alive' )
def __init__(self, tboplayer_instance): self.tboplayer_instance = tboplayer_instance dbus_loop = DBusGMainLoop(set_as_default=True) bus_name = dbus.service.BusName(TBOPLAYER_DBUS_OBJECT, bus = dbus.SessionBus(mainloop = dbus_loop)) Object.__init__(self, bus_name, TBOPLAYER_DBUS_PATH)