'Prepare config for processing'

def prepare_config(self, config):

    from fnmatch import translate
    if (not isinstance(config, dict)):
        config = {}
    config.setdefault(u'to', u'')
    config.setdefault(u'keep_dirs', True)
    config.setdefault(u'unrar_tool', u'')
    config.setdefault(u'delete_archive', False)
    if (u'mask' in config):
        config[u'regexp'] = translate(config[u'mask'])
    if (u'regexp' not in config):
        config[u'regexp'] = u'.'
    return config
