#!/usr/bin/python
"""
The main executable of the application.
Creates a Console object and deploys it.
"""
from repos.repo import Repository
from models.task import Task
from controllers.controller import Controller
from ui.console import Console
from tests.test import Test

def main():
    """
    Run tests before anything.
    """
    try:
        print("Running tests.")
        Test().testEverything()
        print("All tests passed :).\n")
    except Exception as e:
        print("Some tests failed :(.\n")
        print("Reason: %s" % e)

    repo = Repository()
    controller = Controller(repo)
    app = Console(controller)

    app.run()

if __name__=='__main__':
    main()
