summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-07-14 17:24:35 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2008-07-14 17:24:35 +0100
commitee4c9f80cd6a6e839eeebd2e592e4793e9bb61a8 (patch)
treee6213bce9d409eb638205b15ddb9002d23618d43
parent689e366ec0192920bcc961a0c44e89898d9bd8b1 (diff)
downloaddbus-python-ee4c9f80cd6a6e839eeebd2e592e4793e9bb61a8.tar.gz
dbus.server.Server: implement a stub version of _on_new_connection
-rw-r--r--dbus/server.py17
1 files changed, 17 insertions, 0 deletions
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)