from datetime import datetime os.system('/etc/init.d/apache2 start >/dev/null 2>&1') os.system('/etc/init.d/mysql start >/dev/null 2>&1') if not os.path.exists('./Modules/dbconnect.conf'): #~ print "DB Config 'dbconnect.conf' file doesn't seem to exist." print "" sys.exit(1) date = datetime.now() current_project_id = 0 # 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) db_setup.create_reports_table(cur) class Example(wx.Frame): def __init__(self, parent, title):
os.system('/etc/init.d/mysql start') except: print 'Opps, I could not start apache2 or MySQL' if not os.path.exists('./Modules/dbconnect.conf'): #~ print "DB Config 'dbconnect.conf' file doesn't seem to exist." #~ print "Current path is above" sys.exit(1) date = datetime.now() current_project_id = 0 # 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) db_setup.create_reports_table(cur) class Example(wx.Frame): def __init__(self, parent, title):