# 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]


import platform
import sys
import os
    import winreg
from persepolis.constants import OS
    from winreg import QueryValueEx, OpenKey, SetValueEx
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>\n'''
        startupfile = open(
            home_address + '/Library/LaunchAgents/com.persepolisdm.plist', 'w+')
        startupfile.write(entry)
        os.system('launchctl load ' + home_address +
                  "/Library/LaunchAgents/com.persepolisdm.plist")
    # check if it is Windows
    elif os_type == OS.WINDOWS:

        # Connect to the startup path in Registry
        key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
                             "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, winreg.KEY_ALL_ACCESS)
        # find current persepolis exe path
        cwd = os.getcwd()
        persepolisexetray = '"' + cwd + '\Persepolis Download Manager.exe' + '"' + ' --tray'
        # add persepolis to startup
        winreg.SetValueEx(key, 'persepolis', 0,
                          winreg.REG_SZ, persepolisexetray)

        # Close connection
        winreg.CloseKey(key)

# remove startup file


def removestartup():
    # check if it is linux

# 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/startup.py
import platform
import sys
import os
    import winreg
from persepolis.constants import OS
    from winreg import QueryValueEx, OpenKey, SetValueEx

	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>\n'''
        startupfile = open(
            home_address + '/Library/LaunchAgents/com.persepolisdm.plist', 'w+')
        startupfile.write(entry)
        os.system('launchctl load ' + home_address +
                  "/Library/LaunchAgents/com.persepolisdm.plist")
    # check if it is Windows
    elif os_type == OS.WINDOWS:

        # Connect to the startup path in Registry
        key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
                             "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, winreg.KEY_ALL_ACCESS)
        # find current persepolis exe path
        cwd = os.getcwd()
        persepolisexetray = '"' + cwd + '\Persepolis Download Manager.exe' + '"' + ' --tray'
        # add persepolis to startup
        winreg.SetValueEx(key, 'persepolis', 0,
                          winreg.REG_SZ, persepolisexetray)

        # Close connection
        winreg.CloseKey(key)

# remove startup file


def removestartup():
    # check if it is linux

    if os_type in OS.BSD_FAMILY: