trains/logger.py
def _safe_names(func):
    """
    Validate the form of title and series parameters.

    This decorator assert that a method receives 'title' and 'series' as its
    first positional arguments, and that their values have only legal characters.

    '\', '/' and ':' will be replaced automatically by '_'
    Whitespace chars will be replaced automatically by ' '
    """
    _replacements = {
        '_': re.compile(r"[/\\:]"),
        ' ': re.compile(r"[\s]"),
    }

    def _make_safe(value):
        for repl, regex in _replacements.items():
            value = regex.sub(repl, value)
        return value

    @wraps(func)
    def fixed_names(self, title, series, *args, **kwargs):
        title = _make_safe(title)
        series = _make_safe(series)

        func(self, title, series, *args, **kwargs)

    return fixed_names

    Validate the form of title and series parameters.

    This decorator assert that a method receives 'title' and 'series' as its
    first positional arguments, and that their values have only legal characters.

    '\', '/' and ':' will be replaced automatically by '_'
    Whitespace chars will be replaced automatically by ' '
    
Validate the form of title and series parameters.
This decorator assert that a method receives 'title' and 'series' as its
first positional arguments, and that their values have only legal characters.


Validate the form of title and series parameters . This decorator assert that a method receives ' title ' and ' series ' as its first positional arguments and that their values have only legal characters .
def _safe_names(func):
    _replacements = {
        '_': re.compile(r"[/\\:]"),
        ' ': re.compile(r"[\s]"),
    }
    def _make_safe(value):
        for repl, regex in _replacements.items():
            value = regex.sub(repl, value)
        return value
    @wraps(func)
    def fixed_names(self, title, series, *args, **kwargs):
        title = _make_safe(title)
        series = _make_safe(series)
        func(self, title, series, *args, **kwargs)
    return fixed_names
def _safe_names ( func ) : _replacements = { '_' : re . compile ( r"[/\\:]" ) , ' ' : re . compile ( r"[\s]" ) , } def _make_safe ( value ) : for repl , regex in _replacements . items ( ) : value = regex . sub ( repl , value ) return value @ wraps ( func ) def fixed_names ( self , title , series , * args , ** kwargs ) : title = _make_safe ( title ) series = _make_safe ( series ) func ( self , title , series , * args , ** kwargs ) return fixed_names
Validate the form of title and series parameters.
Validate the form of title and series parameters .
"""
    Validate the form of title and series parameters.

    This decorator assert that a method receives 'title' and 'series' as its
    first positional arguments, and that their values have only legal characters.

    '\', '/' and ':' will be replaced automatically by '_'
    Whitespace chars will be replaced automatically by ' '
    """
func