mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-08 15:57:36 +08:00
28 lines
676 B
Python
28 lines
676 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
cd and cd_count properties
|
|
"""
|
|
from rebulk import Rebulk
|
|
from rebulk.remodule import re
|
|
|
|
from ..common import dash
|
|
from ..common.pattern import is_disabled
|
|
from ...config import load_config_patterns
|
|
|
|
|
|
def cd(config): # pylint:disable=unused-argument
|
|
"""
|
|
Builder for rebulk object.
|
|
|
|
:param config: rule configuration
|
|
:type config: dict
|
|
:return: Created Rebulk object
|
|
:rtype: Rebulk
|
|
"""
|
|
rebulk = Rebulk(disabled=lambda context: is_disabled(context, 'cd'))
|
|
rebulk = rebulk.regex_defaults(flags=re.IGNORECASE, abbreviations=[dash])
|
|
|
|
load_config_patterns(rebulk, config)
|
|
|
|
return rebulk
|