mpd: Format multiline patterns properly in docs
(cherry picked from commit e2b36cb0f0)
This commit is contained in:
parent
2b7bc870cf
commit
abc6cc7ac6
@ -15,6 +15,8 @@ from __future__ import unicode_literals
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from mopidy.utils import formatting
|
||||||
|
|
||||||
#: The MPD protocol uses UTF-8 for encoding all data.
|
#: The MPD protocol uses UTF-8 for encoding all data.
|
||||||
ENCODING = 'UTF-8'
|
ENCODING = 'UTF-8'
|
||||||
|
|
||||||
@ -66,8 +68,8 @@ def handle_request(pattern, auth_required=True):
|
|||||||
raise ValueError('Tried to redefine handler for %s with %s' % (
|
raise ValueError('Tried to redefine handler for %s with %s' % (
|
||||||
pattern, func))
|
pattern, func))
|
||||||
request_handlers[compiled_pattern] = func
|
request_handlers[compiled_pattern] = func
|
||||||
func.__doc__ = ' - *Pattern:* ``%s``\n\n%s' % (
|
func.__doc__ = '*Pattern:*\n\n.. code-block:: text\n\n%s\n\n%s' % (
|
||||||
pattern, func.__doc__ or '')
|
formatting.indent(pattern, places=4), func.__doc__ or '')
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user