# Path: Database/db_helpers.py
# class server_stats(object):
# class email_log(object):
# class monitor_list(object):
#     class tcp():
#     class host():
#     class url():
#     def failures_in_x_minutes_ago(last_x_minutes_of_failures):
#     def log_email_sent(to_list):
#     def email_sent_x_minutes_ago():
#     def get_server_list():
#     def get_time_from_last_failure():
#     def log_service_down(server_logger_obj):
#     def remove_server_from_monitor_list(index_to_remove):
#         def __init__(self):
#         def create_server(ip_address, port, note=None):
#         def __init__(self):
#         def create_server(ip_address, note=None):
#         def __init__(self):
#         def create_server(web_url, note=None):
# 
# Path: Alerters/email_controller.py
# class gmailSettings():
# class SettingsHelper(gmailSettings):
# class send_gmail(object, SettingsHelper):
#     USERNAME = ""
#     SEND_ALERT_TO = []  # Must be a list
#     SETTINGS_FILE_PATH = "email_settings.json"
#     KEYRING_APP_ID = 'NetworkMonitor_email'
#     def loadSettings(cls):
#     def saveSettings(cls):
#     def __init__(self):
#     def test_login(self):
#     def send(self, subject, text):
#     def convert_to_list_to_csv(self):
#     def configure(self):
#     def clear_password_store(self):


from datetime import datetime
from Database import db_helpers
from Alerters import email_controller
import logging
                        break
                if monitor_item_type == 'url':
                    host_name_parse = email_actions.parse_url_info(monitor_item_host)
                    if host_name_parse == host_name_fail_event:
                        note_txt = monitor_item[4]
                        break

            if note_txt is None:
                note_txt = ''

            fail_list_txt.append(
                "| {0} | {1} | {2} | {3} | {4} |".format(time_stamp.ljust(w_ts), host_name_fail_event.ljust(w_hn),
                                                         port.ljust(w_p), service.ljust(w_sr),
                                                         note_txt.ljust(w_no)))
            fail_list_txt.append('\n')
            # End of item in list

        # End of list
        fail_list_txt.append('-' * width + '\n', )
        logging.debug('BREAKPOINT')
        return ''.join(fail_list_txt)

    @staticmethod
    def generate_report():
        """ Created report of all fails since last email was sent """

        # Start message creation here
        fail_list = db_helpers.server_stats.failures_in_x_minutes_ago(
            db_helpers.email_log.email_sent_x_minutes_ago())


# Path: Database/db_helpers.py
# class server_stats(object):
# class email_log(object):
# class monitor_list(object):
#     class tcp():
#     class host():
#     class url():
#     def failures_in_x_minutes_ago(last_x_minutes_of_failures):
#     def log_email_sent(to_list):
#     def email_sent_x_minutes_ago():
#     def get_server_list():
#     def get_time_from_last_failure():
#     def log_service_down(server_logger_obj):
#     def remove_server_from_monitor_list(index_to_remove):
#         def __init__(self):
#         def create_server(ip_address, port, note=None):
#         def __init__(self):
#         def create_server(ip_address, note=None):
#         def __init__(self):
#         def create_server(web_url, note=None):
# 
# Path: Alerters/email_controller.py
# class gmailSettings():
# class SettingsHelper(gmailSettings):
# class send_gmail(object, SettingsHelper):
#     USERNAME = ""
#     SEND_ALERT_TO = []  # Must be a list
#     SETTINGS_FILE_PATH = "email_settings.json"
#     KEYRING_APP_ID = 'NetworkMonitor_email'
#     def loadSettings(cls):
#     def saveSettings(cls):
#     def __init__(self):
#     def test_login(self):
#     def send(self, subject, text):
#     def convert_to_list_to_csv(self):
#     def configure(self):
#     def clear_password_store(self):


# Path: Alerters/email_alerts.py
from datetime import datetime
from Database import db_helpers
from Alerters import email_controller
import logging

                        break
                if monitor_item_type == 'url':
                    host_name_parse = email_actions.parse_url_info(monitor_item_host)
                    if host_name_parse == host_name_fail_event:
                        note_txt = monitor_item[4]
                        break

            if note_txt is None:
                note_txt = ''

            fail_list_txt.append(
                "| {0} | {1} | {2} | {3} | {4} |".format(time_stamp.ljust(w_ts), host_name_fail_event.ljust(w_hn),
                                                         port.ljust(w_p), service.ljust(w_sr),
                                                         note_txt.ljust(w_no)))
            fail_list_txt.append('\n')
            # End of item in list

        # End of list
        fail_list_txt.append('-' * width + '\n', )
        logging.debug('BREAKPOINT')
        return ''.join(fail_list_txt)

    @staticmethod
    def generate_report():
        """ Created report of all fails since last email was sent """

        # Start message creation here
        fail_list = db_helpers.server_stats.failures_in_x_minutes_ago(
            db_helpers.email_log.email_sent_x_minutes_ago())


        monitor_list = db_helpers.monitor_list.get_server_list()