def use_theme(theme, directory=None):
    """Switches to the specified theme. This returns False if switching to the already active theme."""
    repo = require_repo(directory)
    if theme not in list_themes(directory):
        raise ThemeNotFoundError(theme)

    old_theme = set_value(repo, 'theme', theme)
    return old_theme != theme
def use_theme ( theme , directory = None ) : repo = require_repo ( directory ) if theme not in list_themes ( directory ) : raise ThemeNotFoundError ( theme ) old_theme = set_value ( repo , 'theme' , theme ) return old_theme != theme
Switches to the specified theme. This returns False if switching to the already active theme.