# 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_warning(*args, **kwargs):
#     print(Color.YELLOW + Color.BOLD + "[!]" + Color.ENDC, *args, **kwargs)
# 
# def print_red(msg):
#     print(Color.RED + msg + Color.ENDC)
# 
# def print_success(*args, **kwargs):
#     print(Color.GREEN + Color.BOLD + "[+]" + Color.ENDC, *args, **kwargs)


import core.io
import time
import base64
import cmd
import socket
import struct
import select
import requests
import xml.dom.minidom
import re
import traceback
import sys
import core.globals
import interface.utils
from interface.messages import print_error, print_help, print_info, print_warning, print_red, \
    print_success
        if 0 <= index < len(self.enum_hosts):
            try:
                xml_root = xml.dom.minidom.parseString(xml_data)
                self.parse_device_info(xml_root, index)
                # self.enum_hosts[index]['serverType'] = xml_headers.getheader('Server')
                self.enum_hosts[index]['serverType'] = xml_headers['Server']
                self.enum_hosts[index]['dataComplete'] = True
                return True
            except Exception as e:
                print_error('Caught exception while getting host info:')
                traceback.print_stack(e)
        return False

    def do_back(self, e):
        return True

    def do_set(self, e):
        args = e.split(' ')
        try:
            if args[0] == "host":
                if interface.utils.validate_ipv4(args[1]):
                    self.host = args[1]
                else:
                    print_error("please provide valid IPv4 address")
            elif args[0] == "port":
                if str.isdigit(args[1]):
                    self.port = args[1]
                else:
                    print_error("port value must be integer")
        except IndexError:

# 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_warning(*args, **kwargs):
#     print(Color.YELLOW + Color.BOLD + "[!]" + Color.ENDC, *args, **kwargs)
# 
# def print_red(msg):
#     print(Color.RED + msg + Color.ENDC)
# 
# def print_success(*args, **kwargs):
#     print(Color.GREEN + Color.BOLD + "[+]" + Color.ENDC, *args, **kwargs)


# Path: modules/misc/generic/upnp_console.py
import core.io
import time
import base64
import cmd
import socket
import struct
import select
import requests
import xml.dom.minidom
import re
import traceback
import sys
import core.globals
import interface.utils
from interface.messages import print_error, print_help, print_info, print_warning, print_red, \
    print_success

        if 0 <= index < len(self.enum_hosts):
            try:
                xml_root = xml.dom.minidom.parseString(xml_data)
                self.parse_device_info(xml_root, index)
                # self.enum_hosts[index]['serverType'] = xml_headers.getheader('Server')
                self.enum_hosts[index]['serverType'] = xml_headers['Server']
                self.enum_hosts[index]['dataComplete'] = True
                return True
            except Exception as e:
                print_error('Caught exception while getting host info:')
                traceback.print_stack(e)
        return False

    def do_back(self, e):
        return True

    def do_set(self, e):
        args = e.split(' ')
        try:
            if args[0] == "host":
                if interface.utils.validate_ipv4(args[1]):
                    self.host = args[1]
                else:
                    print_error("please provide valid IPv4 address")
            elif args[0] == "port":
                if str.isdigit(args[1]):
                    self.port = args[1]
                else:
                    print_error("port value must be integer")
        except IndexError:

            print_error("please specify value for variable")