From ee4c9f80cd6a6e839eeebd2e592e4793e9bb61a8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 14 Jul 2008 17:24:35 +0100 Subject: dbus.server.Server: implement a stub version of _on_new_connection --- dbus/server.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dbus/server.py b/dbus/server.py index 6b7eb50..2cf11c8 100644 --- a/dbus/server.py +++ b/dbus/server.py @@ -31,6 +31,9 @@ class Server(_Server): """An opaque object representing a server that listens for connections from other applications. + This class is not useful to instantiate directly: you must subclass it and + provide an implementation of the _on_new_connection method. + :Since: 0.82.5 """ @@ -54,6 +57,20 @@ class Server(_Server): return super(Server, cls).__new__(cls, address, connection_class, mainloop, auth_mechanisms) + def _on_new_connection(self, conn): + """Respond to the creation of a new Connection. + + :Parameters: + `conn` : dbus.connection.Connection + A D-Bus connection. + + The type of this parameter is whatever was passed + to the Server constructor as the ``connection_class``. + """ + raise NotImplementedError('Subclasses of Server must implement ' + '_on_new_connection') + + address = property(_Server.get_address) id = property(_Server.get_id) is_connected = property(_Server.get_is_connected) -- cgit v1.2.1