haproxy-wi/app/update_db.py

20 lines
506 B
Python
Raw Normal View History

2018-04-24 07:38:48 +00:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-"
import create_db
from configparser import ConfigParser, ExtendedInterpolation
path_config = "haproxy-webintarface.config"
config = ConfigParser(interpolation=ExtendedInterpolation())
config.read(path_config)
mysql_enable = config.get('mysql', 'enable')
if mysql_enable == '1':
from mysql.connector import errorcode
import mysql.connector as sqltool
else:
db = "haproxy-wi.db"
import sqlite3 as sqltool
2018-04-28 07:34:45 +00:00
create_db.create_table()
2018-04-24 07:38:48 +00:00
create_db.update_all()