# 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
            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:
        content = json.dumps(rule)
        con.write(content)


def rule_read(name, get_file_handle=None):
    if get_file_handle:
        return os.path.join(RULES_PATH, name + '.rule')
    with open(os.path.join(RULES_PATH, name + '.rule')) as con:
        content = con.read()
        return content


def rule_write(name, 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

            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:
        content = json.dumps(rule)
        con.write(content)


def rule_read(name, get_file_handle=None):
    if get_file_handle:
        return os.path.join(RULES_PATH, name + '.rule')
    with open(os.path.join(RULES_PATH, name + '.rule')) as con:
        content = con.read()
        return content


def rule_write(name, rule):

    with open(os.path.join(RULES_PATH, name + '.rule'), "w") as con: