# Path: Modules/db_connect_creds.py
# DBCONF = './Modules/dbconnect.conf'
# def entercreds():
# def read_creds():
# def write_creds(username, password):
# 
# Path: Modules/db_setup.py
# INFERNAL_DB = 'InfernalWireless'
# def _test_mysql_conn():
# def create_db(dbcurr, dbname, username, password):
# def create_projects_table(dbcurr):
# def create_reports_table(dbcurr):
# def main():


import MySQLdb
import commands
import logging
import os
import os.path
import sys
import wx
from datetime import datetime
from Modules import db_connect_creds
from Modules import db_setup
    from Modules import infernal_wireless_gui_project

    # ----------------------------------------------------------------------
    def onSendAndClose(self, event):
        """
        Send a message and close frame
        """
        msg = self.msgTxt.GetValue()
        Publisher().sendMessage(("show.mainframe"), msg)
        self.Close()


########################################################################

########################################################################



# ----------------------------------------------------------------------


# TODO - cleanup this too.
username, password = db_connect_creds.read_creds()
cxn = MySQLdb.connect('localhost', username, password)
cur = cxn.cursor()
db_setup.create_db(cur, db_setup.INFERNAL_DB, username, password)
cxn.commit()
cxn.close()

cxn = MySQLdb.connect('localhost', username, password, db=db_setup.INFERNAL_DB)
cur = cxn.cursor()

# Path: Modules/db_connect_creds.py
# DBCONF = './Modules/dbconnect.conf'
# def entercreds():
# def read_creds():
# def write_creds(username, password):
# 
# Path: Modules/db_setup.py
# INFERNAL_DB = 'InfernalWireless'
# def _test_mysql_conn():
# def create_db(dbcurr, dbname, username, password):
# def create_projects_table(dbcurr):
# def create_reports_table(dbcurr):
# def main():


# Path: InfernalWireless.py
import MySQLdb
import commands
import logging
import os
import os.path
import sys
import wx
from datetime import datetime
from Modules import db_connect_creds
from Modules import db_setup
    from Modules import infernal_wireless_gui_project


    # ----------------------------------------------------------------------
    def onSendAndClose(self, event):
        """
        Send a message and close frame
        """
        msg = self.msgTxt.GetValue()
        Publisher().sendMessage(("show.mainframe"), msg)
        self.Close()


########################################################################

########################################################################



# ----------------------------------------------------------------------


# TODO - cleanup this too.
username, password = db_connect_creds.read_creds()
cxn = MySQLdb.connect('localhost', username, password)
cur = cxn.cursor()
db_setup.create_db(cur, db_setup.INFERNAL_DB, username, password)
cxn.commit()
cxn.close()

cxn = MySQLdb.connect('localhost', username, password, db=db_setup.INFERNAL_DB)
cur = cxn.cursor()

db_setup.create_projects_table(cur)