# Path: lib/settings.py
# CHECK_CONF_FILE = os.path.join(ROOT, 'conf/', 'conf.json')
# 
# Path: lib/settings.py
# RULES_CONF_FILE = os.path.join(RULES_PATH, 'rule.conf')
# 
# Path: lib/settings.py
# RULES_PATH = os.path.join(ROOT, 'conf/', 'rules/')


import warnings
import json
import os
import out
from lib.settings import CHECK_CONF_FILE
from lib.settings import RULES_CONF_FILE
from lib.settings import RULES_PATH




warnings.filterwarnings("ignore")


def load():
    with open(CHECK_CONF_FILE) as con:
        try:
            conf = json.load(con)
            return conf
        except:
            out.error("conf.json error, please download another one and replace it.")
            exit()

def update(conf):
    with open(CHECK_CONF_FILE, 'w') as con:
        content = json.dumps(conf).replace("{", "{\n").replace("}", "\n}").replace(", ", ",\n").replace("'", '"')
        con.write(content)
        return


def load_rule():
    with open(RULES_CONF_FILE) as con:
        conf = json.load(con)
        return conf


def update_rule(rule):

# Path: lib/settings.py
# CHECK_CONF_FILE = os.path.join(ROOT, 'conf/', 'conf.json')
# 
# Path: lib/settings.py
# RULES_CONF_FILE = os.path.join(RULES_PATH, 'rule.conf')
# 
# Path: lib/settings.py
# RULES_PATH = os.path.join(ROOT, 'conf/', 'rules/')


# Path: lib/config.py
import warnings
import json
import os
import out
from lib.settings import CHECK_CONF_FILE
from lib.settings import RULES_CONF_FILE
from lib.settings import RULES_PATH





warnings.filterwarnings("ignore")


def load():
    with open(CHECK_CONF_FILE) as con:
        try:
            conf = json.load(con)
            return conf
        except:
            out.error("conf.json error, please download another one and replace it.")
            exit()

def update(conf):
    with open(CHECK_CONF_FILE, 'w') as con:
        content = json.dumps(conf).replace("{", "{\n").replace("}", "\n}").replace(", ", ",\n").replace("'", '"')
        con.write(content)
        return


def load_rule():
    with open(RULES_CONF_FILE) as con:
        conf = json.load(con)
        return conf


def update_rule(rule):

    with open(RULES_CONF_FILE, 'w') as con: