Skip to content

Commit 263f0bd

Browse files
committed
Merge branch 'master' into hh/doc-improvement
2 parents 8eee515 + c628c54 commit 263f0bd

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
with:
2525
ref: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}
2626
fetch-depth: 0
27-
- name: Set up Python 3.9
28-
uses: actions/setup-python@v1
27+
- name: Set up Python 3.12
28+
uses: actions/setup-python@v5
2929
with:
30-
python-version: 3.9
30+
python-version: "3.12"
3131

3232
- name: Install pypa/build
3333
run: >-

varlink/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
- :class:`varlink.ThreadingServer` -- multi-threaded server for concurrent connections
1212
- :class:`varlink.ForkingServer` -- multi-process server (Unix/Linux only)
1313
14-
All server classes live in the ``varlink`` package; import them from ``varlink``, not from
15-
``socketserver``.
16-
1714
For client implementations use the :class:`varlink.Client` class.
1815
1916
For installation and examples, see the GIT repository https://github.com/varlink/python

varlink/error.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def default(self, o):
1616

1717

1818
class VarlinkError(Exception):
19-
"""The base class for varlink error exceptions.
19+
"""The base class for varlink errors.
2020
2121
User-defined errors
2222
~~~~~~~~~~~~~~~~~~~
@@ -26,12 +26,12 @@ class VarlinkError(Exception):
2626
keys to the base ``__init__``. The parameter names and types must match the
2727
``.varlink`` definition manually; there is no automatic binding::
2828
29-
# Given: error ActionFailed (field: string) in the .varlink file
29+
# Given: error ActionFailed (field: string) in an org.example.myinterface.varlink file
3030
3131
class ActionFailed(VarlinkError):
3232
def __init__(self, reason):
3333
VarlinkError.__init__(self, {
34-
"error": "com.example.ActionFailed",
34+
"error": "org.example.myinterface.ActionFailed",
3535
"parameters": {"field": reason},
3636
})
3737

varlink/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,14 @@ def _set_interface(self, filename, interface_class):
290290
def interface(self, filename):
291291
"""Decorator that registers a class as the handler for a varlink interface.
292292
293-
:param filename: A varlink interface name (e.g. ``'com.example.service'``).
293+
:param filename: A varlink interface name (e.g. ``'org.example.service'``).
294294
The file ``{filename}.varlink`` is loaded from the ``interface_dir`` given
295295
to the Service constructor. This must be an interface name or a file path,
296296
**not** a Python class or type.
297297
298298
Example::
299299
300-
@service.interface('com.example.service')
300+
@service.interface('org.example.service')
301301
class Example:
302302
def Echo(self, message):
303303
return {"message": message}
@@ -408,9 +408,9 @@ class Server(BaseServer):
408408
>>> class ServiceRequestHandler(varlink.RequestHandler):
409409
>>> service = service
410410
>>>
411-
>>> @service.interface('com.example.service')
411+
>>> @service.interface('org.example.service')
412412
>>> class Example:
413-
>>> # com.example.service method implementation here …
413+
>>> # org.example.service method implementation here …
414414
>>> pass
415415
>>>
416416
>>> server = varlink.ThreadingServer(sys.argv[1][10:], ServiceRequestHandler)

varlink/tests/test_scanner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_complex() -> None:
8787
invalid_interfacenames = [
8888
"interface .a.b.c\nmethod F()->()",
8989
"interface com.-example.leadinghyphen\nmethod F()->()",
90-
"interface com.example-.danglinghyphen-\nmethod F()->()",
90+
"interface org.example-.danglinghyphen-\nmethod F()->()",
9191
"interface co9.example.number-toplevel\nmethod F()->()",
9292
"interface 1om.example.number-toplevel\nmethod F()->()",
9393
"interface ab\nmethod F()->()",
@@ -118,8 +118,8 @@ def test_interfacename_invalid(description) -> None:
118118
"interface a.1\nmethod F()->()",
119119
"interface a.0.0\nmethod F()->()",
120120
"interface org.varlink.service\nmethod F()->()",
121-
"interface com.example.0example\nmethod F()->()",
122-
"interface com.example.example-dash\nmethod F()->()",
121+
"interface org.example.0example\nmethod F()->()",
122+
"interface org.example.example-dash\nmethod F()->()",
123123
"interface xn--lgbbat1ad8j.example.algeria\nmethod F()->()",
124124
"interface xn--c1yn36f.xn--c1yn36f.xn--c1yn36f\nmethod F()->()",
125125
]

0 commit comments

Comments
 (0)