import click


def get_txt_lines(fromfile):
    """ Get lines from file, strip empty ones, return list """
    try:
        with open(fromfile) as f:
            raw_lines = f.read().splitlines()
    except Exception as e:
        raise click.UsageError("Could not open the source file: " + str(e))
    lines = [r for r in raw_lines if len(r.strip()) > 0]
    return lines