|
@@ -12,13 +12,26 @@ try:
|
|
|
json_data = open('set.json').read()
|
|
json_data = open('set.json').read()
|
|
|
set_data = json.loads(json_data)
|
|
set_data = json.loads(json_data)
|
|
|
except:
|
|
except:
|
|
|
|
|
+ print('오픈나무의 서버 설정 정보를 찾을수 없습니다. 오픈나무를 설정합니다.')
|
|
|
new_json = []
|
|
new_json = []
|
|
|
|
|
|
|
|
- print('DB 이름 : ', end = '')
|
|
|
|
|
- new_json += [input()]
|
|
|
|
|
|
|
+ print('DB 이름(입력하지 않고 Enter키를 누르면 openNamu.db로 설정됩니다.) : ', end = '')
|
|
|
|
|
+ db_name = input()
|
|
|
|
|
+ if db_name:
|
|
|
|
|
+ pass
|
|
|
|
|
+ else:
|
|
|
|
|
+ db_name = "openNamu.db"
|
|
|
|
|
|
|
|
- print('포트 : ', end = '')
|
|
|
|
|
- new_json += [input()]
|
|
|
|
|
|
|
+ new_json.append(db_name)
|
|
|
|
|
+
|
|
|
|
|
+ print('포트(입력하지 않고 Enter키를 누르면 80으로 설정됩니다.) : ', end = '')
|
|
|
|
|
+ port = input()
|
|
|
|
|
+ if port:
|
|
|
|
|
+ pass
|
|
|
|
|
+ else:
|
|
|
|
|
+ port = str(80)
|
|
|
|
|
+
|
|
|
|
|
+ new_json.append(port)
|
|
|
|
|
|
|
|
with open("set.json", "w") as f:
|
|
with open("set.json", "w") as f:
|
|
|
f.write('{ "db" : "' + new_json[0] + '", "port" : "' + new_json[1] + '" }')
|
|
f.write('{ "db" : "' + new_json[0] + '", "port" : "' + new_json[1] + '" }')
|
|
@@ -26,6 +39,7 @@ except:
|
|
|
json_data = open('set.json').read()
|
|
json_data = open('set.json').read()
|
|
|
set_data = json.loads(json_data)
|
|
set_data = json.loads(json_data)
|
|
|
|
|
|
|
|
|
|
+
|
|
|
conn = sqlite3.connect(set_data['db'] + '.db')
|
|
conn = sqlite3.connect(set_data['db'] + '.db')
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
|
|
|
|