# Path: ifs/lib.py
# def get_download_filename(url, target):
# def download(url, target):
# def list_app_names():
# def list_apps():
# def search_app_strings(term):
# def export_source(source):
# def match_semver(string):
# def read_last_updated():
# def write_last_updated():
# def out_of_date(delay=86400):
#     def __init__(self, cmd):
#     def execute(self, autoprint=False):
#     def run(cls, cmd, autoprint=False):
#     def __init__(self, name, module=None):
#     def load(cls, app_name):
#     def load_external(cls, path):
#     def get_download_url(self, version=None):
#     def check_version(self):
#     def info(self):
#     def cmd_install_deps(self):
#     def cmd_install_app(self, version=None):
#     def install(self, version=None):
# class Cmd(object):
# class App(object):


import sys
import datetime
import click
from textwrap import TextWrapper, dedent
from colorama import Style, Fore
from ifs import lib
        exit(0)
    if installed_version and not version and not force:
        click.echo('%s %s is already installed' %
                   (app.name, installed_version))
        exit(0)

    cmd = app.install(version)
    if cmd.returncode == 0:
        ok("Successfully installed %s version %s" % (app.name, version))
    else:
        error("Error installing %s" % app.name)
    exit(cmd.returncode)


@cli.command()
@click.argument('source', type=click.Path(exists=True))
def source(source):
    """
    Install from a custom source.

      ifs source /path/to/source.py

    ifs ships with some built-in source files. This command allows you to load
    your own, arbitrarily-defined source file at runtime. Think of it as the
    bash source built-in for ifs.

    Note: The source file should be a python file with the same basic structure
    as one of the built-in source files. Run `ifs export template` to create a
    new one.
    """

# Path: ifs/lib.py
# def get_download_filename(url, target):
# def download(url, target):
# def list_app_names():
# def list_apps():
# def search_app_strings(term):
# def export_source(source):
# def match_semver(string):
# def read_last_updated():
# def write_last_updated():
# def out_of_date(delay=86400):
#     def __init__(self, cmd):
#     def execute(self, autoprint=False):
#     def run(cls, cmd, autoprint=False):
#     def __init__(self, name, module=None):
#     def load(cls, app_name):
#     def load_external(cls, path):
#     def get_download_url(self, version=None):
#     def check_version(self):
#     def info(self):
#     def cmd_install_deps(self):
#     def cmd_install_app(self, version=None):
#     def install(self, version=None):
# class Cmd(object):
# class App(object):


# Path: ifs/cli.py
import sys
import datetime
import click
from textwrap import TextWrapper, dedent
from colorama import Style, Fore
from ifs import lib

        exit(0)
    if installed_version and not version and not force:
        click.echo('%s %s is already installed' %
                   (app.name, installed_version))
        exit(0)

    cmd = app.install(version)
    if cmd.returncode == 0:
        ok("Successfully installed %s version %s" % (app.name, version))
    else:
        error("Error installing %s" % app.name)
    exit(cmd.returncode)


@cli.command()
@click.argument('source', type=click.Path(exists=True))
def source(source):
    """
    Install from a custom source.

      ifs source /path/to/source.py

    ifs ships with some built-in source files. This command allows you to load
    your own, arbitrarily-defined source file at runtime. Think of it as the
    bash source built-in for ifs.

    Note: The source file should be a python file with the same basic structure
    as one of the built-in source files. Run `ifs export template` to create a
    new one.
    """

    app = lib.App.load_external(source)