from selenium import webdriver

from companies.red_hat import red_hat


def print_result(info):
    """Takes in a dictionary with keys for 'company', 'title', 'url',
    and 'description' and prints them neatly to the terminal"""

    for key in ['company', 'title', 'url', 'description']:
        assert key in info.keys(), \
            "The key '{}' is not in the dictionary".format(key)
        assert isinstance(info[key], str), \
            "The value at '{}' is not a string".format(key)

    print('{} - {}'.format(info['company'], info['title']))
    print(info['url'])
    print(info['description'])


def main():
    driver = webdriver.Firefox()

    red_hat(driver)

    driver.close()
    # print_result({'company': 'comp',
    #               'title': 'title',
    #               'url': 'url.com',
    #               'description': 'things and stuff'})


if __name__ == "__main__":
    main()

@@ -63,16 +63,62 @@
 red_hat%0A
+from app import db%0Afrom models import Company%0A
 %0A%0Adef pr
@@ -701,20 +701,261 @@
 x()%0A
-%0A    red_hat
+    company_dict = %7B%0A        %22Red Hat%22: red_hat,%0A    %7D%0A    interesting_companies = db.session.query(Company) %5C%0A                                      .filter(Company.interest == True)%0A    for comp in interesting_companies:%0A        company_dict%5Bcomp.name%5D
 (dri

running company script if Company.interest is True