mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Move common libs to libs/common
This commit is contained in:
parent
8dbb1a2451
commit
1f4bd41bcc
1612 changed files with 962 additions and 10 deletions
23
libs/common/rebulk/formatters.py
Normal file
23
libs/common/rebulk/formatters.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/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
|
Loading…
Add table
Add a link
Reference in a new issue