Exemplo n.º 1
0
def install_theme(name):
    theme = find_theme(theme_name=name, silence=True)
    if theme:
        # Update theme
        if not os.path.exists(os.path.join(theme.path, '.git')):
            logger.warn("%s is not installed via git."
                        "Can't update it." % theme.name)
        else:
            logger.info("Updating theme %s" % theme.name)
            call("git pull", cwd=theme.path)
        exit(0)

    if ".git" in name or "//" in name:
        install_from_git(name)
    else:
        search_github(name)
Exemplo n.º 2
0
def install_theme(name):
    theme = find_theme(theme_name=name, silence=True)
    if theme:
        # Update theme
        if not os.path.exists(os.path.join(theme.path, '.git')):
            logger.warn("%s is not installed via git."
                        "Can't update it." % theme.name)
        else:
            logger.info("Updating theme %s" % theme.name)
            call("git pull", cwd=theme.path)
        exit(0)

    if ".git" in name or "//" in name:
        install_from_git(name)
    else:
        search_github(name)
Exemplo n.º 3
0
def search_and_install(name):
    logger.info("Searching theme {name} on GitHub..".format(name=name))
    item = search_github(name=name)
    if not item:
        logger.error("Can't find theme {name}.".format(name=name))
        exit(1)

    logger.info("Fount {name} on GitHub.".format(name=item["name"]))
    install_from_git(item["clone_url"])
Exemplo n.º 4
0
def search_and_install(name):
    logger.info("Searching theme {name} on GitHub..".format(name=name))
    item = search_github(name=name)
    if not item:
        logger.error("Can't find theme {name}.".format(name=name))
        exit(1)

    logger.info("Fount {name} on GitHub.".format(name=item["name"]))
    install_from_git(item["clone_url"])
Exemplo n.º 5
0
def install_theme(name):
    theme = find_theme(theme_name=name, silence=True)
    if theme:
        # Update theme
        if not os.path.exists(os.path.join(theme.path, '.git')):
            logger.warn("%s is not installed via git."
                        "Can't update it." % theme.name)
        else:
            logger.info("Updating theme %s" % theme.name)
            call("git pull", cwd=theme.path)
        exit(0)
    if ".git" in name or "//" in name:
        install_from_git(name)
    else:
        item = search_github(name)
        if not item:
            logger.error("Can't find {} on GitHub.".format(name))
            exit(1)
        install_from_git(item["clone_url"])
Exemplo n.º 6
0
def install_theme(name):
    theme = find_theme(theme_name=name, silence=True)
    if theme:
        # Update theme
        if not os.path.exists(os.path.join(theme.path, '.git')):
            logger.warn("%s is not installed via git."
                        "Can't update it." % theme.name)
        else:
            logger.info("Updating theme %s" % theme.name)
            call("git pull", cwd=theme.path)
        exit(0)
    if ".git" in name or "//" in name:
        install_from_git(name)
    else:
        item = search_github(name)
        if not item:
            logger.error("Can't find {} on GitHub.".format(name))
            exit(1)
        install_from_git(item["clone_url"])
Exemplo n.º 7
0
def test_search_github():
    theme = search_github("clean")
    assert theme["name"] == "catsup-theme-clean"
    assert theme[
        "clone_url"] == "https://github.com/whtsky/catsup-theme-clean.git"