You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
572 B
24 lines
572 B
6 years ago
|
#!/usr/bin/env python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
"""
|
||
|
Formatter functions to use in patterns.
|
||
|
|
||
|
All those function have last argument as match.value (str).
|
||
|
"""
|
||
|
|
||
|
|
||
|
def formatters(*chained_formatters):
|
||
|
"""
|
||
|
Chain formatter functions.
|
||
|
:param chained_formatters:
|
||
|
:type chained_formatters:
|
||
|
:return:
|
||
|
:rtype:
|
||
|
"""
|
||
|
def formatters_chain(input_string): # pylint:disable=missing-docstring
|
||
|
for chained_formatter in chained_formatters:
|
||
|
input_string = chained_formatter(input_string)
|
||
|
return input_string
|
||
|
|
||
|
return formatters_chain
|