mpd: Format multiline patterns properly, second try
(cherry picked from commit f383e9ad48)
This commit is contained in:
parent
55afa18672
commit
54caa95fb4
@ -68,8 +68,18 @@ 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:*\n\n.. code-block:: text\n\n%s\n\n%s' % (
|
func.__doc__ = """
|
||||||
formatting.indent(pattern, places=4), func.__doc__ or '')
|
*Pattern:*
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
%(pattern)s
|
||||||
|
|
||||||
|
%(docs)s
|
||||||
|
""" % {
|
||||||
|
'pattern': formatting.indent(pattern, places=8, singles=True),
|
||||||
|
'docs': func.__doc__ or '',
|
||||||
|
}
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user