@staticmethod
def prepare_config(config):
    """Prepare config for processing"""
    from fnmatch import translate
    if not isinstance(config, dict):
        config = {}
    config.setdefault('to', '')
    config.setdefault('keep_dirs', True)
    config.setdefault('unrar_tool', '')
    config.setdefault('delete_archive', False)
    if 'mask' in config:
        config['regexp'] = translate(config['mask'])
    if 'regexp' not in config:
        config['regexp'] = '.'
    return config
