# 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
    else:
        # so we have single download
        dict = {'gid': gid,
                'shutdown': 'wait'}

        # update data base
        parent.temp_db.updateSingleTable(dict)

    shutdown_status = "wait"

    while shutdown_status == "wait":
        sleep(5)

        # get shutdown status from data_base
        if category != None:
            dict = parent.temp_db.returnCategory(category)
        else:
            dict = parent.temp_db.returnGid(gid)

        shutdown_status = dict['shutdown']

    if shutdown_status == "shutdown":

        logger.sendToLog("Shutting down in 20 seconds", "INFO")
        sleep(20)

        if os_type == OS.LINUX:

            pipe = subprocess.Popen(['sudo', '-S', 'poweroff'],
                                    stdout=subprocess.DEVNULL,

# 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

    else:
        # so we have single download
        dict = {'gid': gid,
                'shutdown': 'wait'}

        # update data base
        parent.temp_db.updateSingleTable(dict)

    shutdown_status = "wait"

    while shutdown_status == "wait":
        sleep(5)

        # get shutdown status from data_base
        if category != None:
            dict = parent.temp_db.returnCategory(category)
        else:
            dict = parent.temp_db.returnGid(gid)

        shutdown_status = dict['shutdown']

    if shutdown_status == "shutdown":

        logger.sendToLog("Shutting down in 20 seconds", "INFO")
        sleep(20)

        if os_type == OS.LINUX:

            pipe = subprocess.Popen(['sudo', '-S', 'poweroff'],
                                    stdout=subprocess.DEVNULL,

                                    stdin=subprocess.PIPE,