Skip to content

Commit c573a05

Browse files
committed
arg fix
1 parent 2411697 commit c573a05

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/source/servercode.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ The code above could also be written as::
250250

251251
You can perform some limited customization:
252252

253-
.. py:method:: serve(objects [host=None, port=0, daemon=None, ns=True, verbose=True])
253+
.. py:method:: serve(objects [host=None, port=0, daemon=None, use_ns=True, verbose=True])
254254
255255
Very basic method to fire up a daemon that hosts a bunch of objects.
256256
The objects will be registered automatically in the name server if you specify this.
@@ -266,20 +266,20 @@ You can perform some limited customization:
266266
:param daemon: optional existing daemon to use, that you created yourself.
267267
If you don't specify this, the method will create a new daemon object by itself.
268268
:type daemon: Pyro5.server.Daemon
269-
:param ns: optional, if True (the default), the objects will also be registered in the name server (located using :py:meth:`Pyro5.core.locate_ns`) for you.
269+
:param use_ns: optional, if True (the default), the objects will also be registered in the name server (located using :py:meth:`Pyro5.core.locate_ns`) for you.
270270
If this parameters is False, your objects will only be hosted in the daemon and are not published in a name server.
271271
Read below about the exact behavior of the object names you provide in the ``objects`` dictionary.
272272
:type ns: bool
273273
:param verbose: optional, if True (the default), print out a bit of info on the objects that are registered
274274
:type verbose: bool
275275
:returns: nothing, it starts the daemon request loop and doesn't return until that stops.
276276

277-
If you set ``ns=True`` your objects will appear in the name server as well (this is the default setting).
277+
If you set ``use_ns=True`` (the default) your objects will appear in the name server as well.
278278
Usually this means you provide a logical name for every object in the ``objects`` dictionary.
279279
If you don't (= set it to ``None``), the object will still be available in the daemon (by a generated name) but will *not* be registered
280280
in the name server (this is a bit strange, but hey, maybe you don't want all the objects to be visible in the name server).
281281

282-
When not using a name server at all (``ns=False``), the names you provide are used as the object names
282+
When not using a name server at all (``use_ns=False``), the names you provide are used as the object names
283283
in the daemon itself. If you set the name to ``None`` in this case, your object will get an automatically generated internal name,
284284
otherwise your own name will be used.
285285

tests/test_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ def testSimpleServeLegacy(self):
11221122
o1 = MyThingPartlyExposed(1)
11231123
o2 = MyThingPartlyExposed(2)
11241124
objects = {o1: "test.o1", o2: None}
1125-
Pyro5.server.serve(objects, daemon=d, ns=False, verbose=False)
1125+
Pyro5.server.serve(objects, daemon=d, use_ns=False, verbose=False)
11261126
assert len(d.objectsById) == 3
11271127
assert "test.o1" in d.objectsById
11281128
assert o1 in d.objectsById.values()
@@ -1146,7 +1146,7 @@ def testSimpleServeSameNamesLegacy(self):
11461146
o3 = MyThingPartlyExposed(3)
11471147
objects = {o1: "test.name", o2: "test.name", o3: "test.othername"}
11481148
with pytest.raises(Pyro5.errors.DaemonError):
1149-
Pyro5.server.serve(objects, daemon=d, ns=False, verbose=False)
1149+
Pyro5.server.serve(objects, daemon=d, use_ns=False, verbose=False)
11501150

11511151
def testSimpleServeSameNames(self):
11521152
with TestSimpleServe.DaemonWrapper() as d:

0 commit comments

Comments
 (0)