mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2024-11-14 17:40:24 -08:00
2226a74ef8
Updates python-dateutil to 2.8.2 Updates rebulk to 2.0.1
34 lines
712 B
Python
34 lines
712 B
Python
#!/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
|
|
|
|
|
|
def default_formatter(input_string):
|
|
"""
|
|
Default formatter
|
|
:param input_string:
|
|
:return:
|
|
"""
|
|
return input_string
|