summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-07-14 16:41:28 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2008-07-14 16:41:28 +0100
commit87a86d7d6033cbb61271a84f20d5d25c4b4182c0 (patch)
tree9faa100c0c6552fcc168f7f257aca73f36d08c4c /dbus
parent8e213001de0523bd7971fc9251c56635a9e943db (diff)
DBusPyServer: construct a user-specified subtype of Connection
Diffstat (limited to 'dbus')
-rw-r--r--dbus/server.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/dbus/server.py b/dbus/server.py
index c7a6184..632e7cd 100644
--- a/dbus/server.py
+++ b/dbus/server.py
@@ -1,4 +1,5 @@
# Copyright (C) 2008 Openismus GmbH <http://openismus.com/>
+# Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -24,6 +25,7 @@ __all__ = ('Server', )
__docformat__ = 'reStructuredText'
from _dbus_bindings import Server as _Server
+from dbus.connection import Connection
class Server(_Server):
"""An opaque object representing a server that listens for connections from
@@ -32,6 +34,24 @@ class Server(_Server):
:Since: 0.82.5
"""
+ def __new__(cls, address, connection_class=Connection,
+ mainloop=None, auth_mechanisms=None):
+ """Construct a new Server.
+
+ :Parameters:
+ `address` : str
+ Listen on this address.
+ `connection_class` : type
+ When new connections come in, instantiate this subclass
+ of dbus.connection.Connection to represent them.
+ The default is Connection.
+ `mainloop` : dbus.mainloop.NativeMainLoop or None
+ The main loop with which to associate the new connections.
+ `auth_mechanisms` : sequence of str
+ Authentication mechanisms to allow. The default is to allow
+ any authentication mechanism supported by ``libdbus``.
+ """
+
address = property(_Server.get_address)
id = property(_Server.get_id)
is_connected = property(_Server.get_is_connected)