#!/usr/bin/python3

import sys
import os
import sqlite3
import shutil
import time
import configparser


def init():
    config = configparser.SafeConfigParser()
    config.read("ddldiffer.conf")
    #print(config.get('database', 'host'))

def help():
    text = (
	'Usage:\n'
	' ddldiffer dump        Reverse MySQL Server and Dump DDL  \n'
        ' ddldiffer diff        Compare dump DDL to local file'
    )
    print(text)
    return

def dump():

    return

def diff():
    return 

if __name__ == "__main__":
    init()    
    argvs = sys.argv
    if len(argvs) < 2:
        help()
    elif argvs[1] == "dump":
        dump()
    elif argvs[1] == "diff":
        diff()
    else:
        print("Undefined operand");



@@ -45,15 +45,15 @@
 ort 
-sqlite3
+os.path
 %0Aimp
@@ -105,24 +105,42 @@
 def init():%0A
+    global config%0A
     config =
@@ -214,15 +214,15 @@
     
-#print(
+path = 
 conf
@@ -233,27 +233,146 @@
 et('
-database', 'host'))
+local','sqlpath');%0A    if os.path.exists(path) != True:%0A        print(%22Can't accesss sqlpath :%22, path);%0A        exit(-1)%0A    return config
 %0A%0Ade
@@ -576,15 +576,435 @@
 def 
-dump():
+readConfig(section,key):%0A    result = config.get(section, key)%0A    # TODO Error Check%0A    return result%0A%0Adef dump():%0A    # Ready Connect Database%0A    host = readConfig('database','host')%0A    user = readConfig('database','user')%0A    passwd = readConfig('database','passwd')%0A    port = readConfig('database', 'port')%0A    db = readConfig('database','database')%0A%0A    # Connect%0A%0A%0A    # GetTableList%0A%0A%0A    # GetDDL%0A%0A%0A    # DisConnect
 %0A%0A  

Add function-frame