'Search themes from specified directory.'

def find_themes(self, theme_path):

    themes = {}
    if (not path.isdir(theme_path)):
        return themes
    for entry in os.listdir(theme_path):
        pathname = path.join(theme_path, entry)
        if (path.isfile(pathname) and entry.lower().endswith('.zip')):
            if is_archived_theme(pathname):
                name = entry[:(-4)]
                themes[name] = pathname
            else:
                logger.warning(__('file    %r    on    theme    path    is    not    a    valid    zipfile    or    contains    no    theme'), entry)
        elif path.isfile(path.join(pathname, THEMECONF)):
            themes[entry] = pathname
    return themes
