# Path: core/loader.py
# def load_module(modname):
# def delete_module(modname, paranoid=None):
# def check_dependencies():
# def check_create_dirs():
# def open_database(path):
# def close_database(connection):
# 
# Path: core/updater.py
# def update_rext():
# def update_rext_force():
# def update_oui():
# 
# Path: interface/messages.py
# def print_error(*args, **kwargs):
#     print(Color.RED + Color.BOLD + "[-]" + Color.ENDC, *args, **kwargs)
# 
# def print_help(*args, **kwargs):
#     print(Color.PURPLE + Color.BOLD + "[?]" + Color.ENDC, *args, **kwargs)
# 
# def print_info(*args, **kwargs):
#     print(Color.BLUE + Color.BOLD + "[*]" + Color.ENDC, *args, **kwargs)
# 
# def print_success(*args, **kwargs):
#     print(Color.GREEN + Color.BOLD + "[+]" + Color.ENDC, *args, **kwargs)


import cmd
import sys
import interface.utils
import core.globals
from core import loader
from core import updater
from interface.messages import print_error, print_help, print_info, print_success
                    loader.delete_module(self.active_module_import_name)  # Module is unloaded so it can be used again
                except ValueError:
                    pass
                core.globals.active_module_import_name = ""
            elif isinstance(self.active_module, dict):  # Else change directory depth
                if module in self.active_module.keys():
                    self.active_module = self.active_module.get(module)
                    core.globals.active_module_path += module + "/"
                    interface.utils.change_prompt(self, core.globals.active_module_path)
                else:
                    print_error(module + " not found")  # If error occurred then print error and break parsing
                    break

    def do_unload(self, e):
        self.active_module = self.modules  # Change every setting to REXT root
        interface.utils.change_prompt(self, None)
        core.globals.active_module_path = ""

    def do_update(self, e):
        args = e.split(' ')
        if args[0] == "oui":
            print_info("Updating OUI DB. Database rebuild may take several minutes.")
            # print_blue("Do you wish to continue? (y/n)")
            # Add if here
            updater.update_oui()
            print_success("OUI database updated successfully.")
        elif args[0] == "force":
            print_info("Discarding local changes and updating REXT")
            updater.update_rext_force()
        elif args[0] == "":

# Path: core/loader.py
# def load_module(modname):
# def delete_module(modname, paranoid=None):
# def check_dependencies():
# def check_create_dirs():
# def open_database(path):
# def close_database(connection):
# 
# Path: core/updater.py
# def update_rext():
# def update_rext_force():
# def update_oui():
# 
# Path: interface/messages.py
# def print_error(*args, **kwargs):
#     print(Color.RED + Color.BOLD + "[-]" + Color.ENDC, *args, **kwargs)
# 
# def print_help(*args, **kwargs):
#     print(Color.PURPLE + Color.BOLD + "[?]" + Color.ENDC, *args, **kwargs)
# 
# def print_info(*args, **kwargs):
#     print(Color.BLUE + Color.BOLD + "[*]" + Color.ENDC, *args, **kwargs)
# 
# def print_success(*args, **kwargs):
#     print(Color.GREEN + Color.BOLD + "[+]" + Color.ENDC, *args, **kwargs)


# Path: interface/cmdui.py
import cmd
import sys
import interface.utils
import core.globals
from core import loader
from core import updater
from interface.messages import print_error, print_help, print_info, print_success

                    loader.delete_module(self.active_module_import_name)  # Module is unloaded so it can be used again
                except ValueError:
                    pass
                core.globals.active_module_import_name = ""
            elif isinstance(self.active_module, dict):  # Else change directory depth
                if module in self.active_module.keys():
                    self.active_module = self.active_module.get(module)
                    core.globals.active_module_path += module + "/"
                    interface.utils.change_prompt(self, core.globals.active_module_path)
                else:
                    print_error(module + " not found")  # If error occurred then print error and break parsing
                    break

    def do_unload(self, e):
        self.active_module = self.modules  # Change every setting to REXT root
        interface.utils.change_prompt(self, None)
        core.globals.active_module_path = ""

    def do_update(self, e):
        args = e.split(' ')
        if args[0] == "oui":
            print_info("Updating OUI DB. Database rebuild may take several minutes.")
            # print_blue("Do you wish to continue? (y/n)")
            # Add if here
            updater.update_oui()
            print_success("OUI database updated successfully.")
        elif args[0] == "force":
            print_info("Discarding local changes and updating REXT")
            updater.update_rext_force()
        elif args[0] == "":

            print_info("Updating REXT please wait...")