# 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
    def emptyline(self):
        pass

    def postloop(self):
        print("Bye!")

    def do_exit(self, args):
        loader.close_database(core.globals.ouidb_conn)
        return True

    # Interpreter commands section
    # This was not written with performance in mind exactly...
    def do_show(self, module):
        if module == "":
            if isinstance(self.active_module, dict):
                for key in sorted(self.active_module.keys()):
                    print(key)
            elif isinstance(self.active_module, set):
                for file in sorted(self.active_module):
                    print(file)
        elif module == "modules":
            for key in sorted(self.modules.keys()):
                print(key)
        elif module in self.modules.keys():
            for key in sorted(self.modules.get(module).keys()):
                print(key)
        elif (self.active_module is dict) and (module in self.active_module.keys()):
            for key in sorted(self.active_module.get(module)):  # Yeah lot of sorting going on I know
                print(key)
        else:

# 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

    def emptyline(self):
        pass

    def postloop(self):
        print("Bye!")

    def do_exit(self, args):
        loader.close_database(core.globals.ouidb_conn)
        return True

    # Interpreter commands section
    # This was not written with performance in mind exactly...
    def do_show(self, module):
        if module == "":
            if isinstance(self.active_module, dict):
                for key in sorted(self.active_module.keys()):
                    print(key)
            elif isinstance(self.active_module, set):
                for file in sorted(self.active_module):
                    print(file)
        elif module == "modules":
            for key in sorted(self.modules.keys()):
                print(key)
        elif module in self.modules.keys():
            for key in sorted(self.modules.get(module).keys()):
                print(key)
        elif (self.active_module is dict) and (module in self.active_module.keys()):
            for key in sorted(self.active_module.get(module)):  # Yeah lot of sorting going on I know
                print(key)
        else:

            print_error("Invalid argument for command show " + module)