# Path: persepolis/scripts/logger.py
# def sendToLog(text="", type="INFO"):
# 
# Path: persepolis/constants/Os.py
# class OS:
#     LINUX = 'Linux'
#     WINDOWS = 'Windows'
#     FREE_BSD = 'FreeBSD'
#     OPEN_BSD = 'OpenBSD'
#     OSX = DARWIN = 'Darwin'
#     BSD_FAMILY = [FREE_BSD, OPEN_BSD]
#     UNIX_LIKE = BSD_FAMILY + [LINUX]
#     LIST = [LINUX, WINDOWS, FREE_BSD, OPEN_BSD, OSX]


from persepolis.scripts import logger
from persepolis.constants import OS
from time import sleep
import subprocess
import platform
        if os_type == OS.LINUX:

            pipe = subprocess.Popen(['sudo', '-S', 'poweroff'],
                                    stdout=subprocess.DEVNULL,
                                    stdin=subprocess.PIPE,
                                    stderr=subprocess.DEVNULL,
                                    shell=False)

            pipe.communicate(password.encode())

        elif os_type == OS.DARWIN:

            pipe = subprocess.Popen(['sudo', '-S', 'shutdown', '-h', 'now'],
                                    stdout=subprocess.DEVNULL,
                                    stdin=subprocess.PIPE,
                                    stderr=subprocess.DEVNULL,
                                    shell=False)

            pipe.communicate(password.encode())

        elif os_type == OS.WINDOWS:

            CREATE_NO_WINDOW = 0x08000000
            subprocess.Popen(['shutdown', '-S'],
                             stderr=subprocess.PIPE,
                             stdout=subprocess.PIPE,
                             stdin=subprocess.PIPE,
                             shell=False,
                             creationflags=CREATE_NO_WINDOW)


# Path: persepolis/scripts/logger.py
# def sendToLog(text="", type="INFO"):
# 
# Path: persepolis/constants/Os.py
# class OS:
#     LINUX = 'Linux'
#     WINDOWS = 'Windows'
#     FREE_BSD = 'FreeBSD'
#     OPEN_BSD = 'OpenBSD'
#     OSX = DARWIN = 'Darwin'
#     BSD_FAMILY = [FREE_BSD, OPEN_BSD]
#     UNIX_LIKE = BSD_FAMILY + [LINUX]
#     LIST = [LINUX, WINDOWS, FREE_BSD, OPEN_BSD, OSX]


# Path: persepolis/scripts/shutdown.py
from persepolis.scripts import logger
from persepolis.constants import OS
from time import sleep
import subprocess
import platform

        if os_type == OS.LINUX:

            pipe = subprocess.Popen(['sudo', '-S', 'poweroff'],
                                    stdout=subprocess.DEVNULL,
                                    stdin=subprocess.PIPE,
                                    stderr=subprocess.DEVNULL,
                                    shell=False)

            pipe.communicate(password.encode())

        elif os_type == OS.DARWIN:

            pipe = subprocess.Popen(['sudo', '-S', 'shutdown', '-h', 'now'],
                                    stdout=subprocess.DEVNULL,
                                    stdin=subprocess.PIPE,
                                    stderr=subprocess.DEVNULL,
                                    shell=False)

            pipe.communicate(password.encode())

        elif os_type == OS.WINDOWS:

            CREATE_NO_WINDOW = 0x08000000
            subprocess.Popen(['shutdown', '-S'],
                             stderr=subprocess.PIPE,
                             stdout=subprocess.PIPE,
                             stdin=subprocess.PIPE,
                             shell=False,
                             creationflags=CREATE_NO_WINDOW)


        elif os_type in OS.BSD_FAMILY: