import platform
import os
import time


class BaseColors(object):
    """
    Holds base colors used in `terminal`
    """
    HEADER = "\033[95m"
    BLUE = "\033[94m"
    GREEN = "\033[92m"
    WARNING = "\033[93m"
    RED = "\033[91m"
    ENDCOLOR = "\033[0m"
    BOLD = "\033[1m"
    UNDERLINE = "\033[4m"


class OSXDodger(BaseColors):
    allowed_version = "10.6.1"
    allowed_system = "darwin"

    def __init__(self):
        self.app_dir = "/Applications/"
        self.system_files = [".DS_Store", ".localized"]

    def load_applications(self):
        """
        Read all applications in the `/Applications/` dir
        """
        if self.pc_is_macintosh():
            all_apps = os.listdir(self.app_dir)
            print(BaseColors.GREEN + "Loading applications...")
            time.sleep(1)

            print("\n\nAPP NUMBER\t\tAPPLICATION NAME" + BaseColors.ENDCOLOR)

            for index, app in enumerate(all_apps):
                if app not in self.system_files:
                    print (index + 1), "\t\t\t" + app.replace(".app", "")

    def select_applications(self):
        """
        Allow user to select an application they want
        not to appear on the Dock
        """
        pass

    def load_dodger_filer(self):
        """
        Load the file to modify for the application
        chosen by the user in `select_applications`

        The file to be loaded for is `info.plist`
        """
        pass

    def dodge_application(self):
        """
        Remive the application from the Dock
        """
        pass

    @classmethod
    def pc_is_macintosh(cls):
        """
        Check if it is an `Apple Computer` i.e a Mac
        @return bool
        """
        system = platform.system().lower()
        sys_version = int((platform.mac_ver())[0].replace(".", ""))
        allowed_version = int(cls.allowed_version.replace(".", ""))

        if (system == cls.allowed_system) and (sys_version >= allowed_version):
            return True
        else:
            print("\nSorry :(")
            print("FAILED. OsX-dock-dodger is only applicable to computers " +
                  "running OS X {} or higher".format(cls.allowed_version))
            return False

dodge = OSXDodger()
dodge.load_applications()

@@ -13,302 +13,8 @@
 orm%0A
-import os%0Aimport time%0A%0A%0Aclass BaseColors(object):%0A    %22%22%22%0A    Holds base colors used in %60terminal%60%0A    %22%22%22%0A    HEADER = %22%5C033%5B95m%22%0A    BLUE = %22%5C033%5B94m%22%0A    GREEN = %22%5C033%5B92m%22%0A    WARNING = %22%5C033%5B93m%22%0A    RED = %22%5C033%5B91m%22%0A    ENDCOLOR = %22%5C033%5B0m%22%0A    BOLD = %22%5C033%5B1m%22%0A    UNDERLINE = %22%5C033%5B4m%22%0A
 %0A%0Acl
@@ -27,26 +27,22 @@
 XDodger(
-BaseColors
+object
 ):%0A    a
@@ -115,24 +115,42 @@
 _init__(self
+, applications_dir
 ):%0A        s
@@ -167,11 +167,9 @@
 r = 
-%22/A
+a
 ppli
@@ -179,66 +179,12 @@
 ions
-/%22%0A        self.system_files = %5B%22.DS_Store%22, %22.localized%22%5D
+_dir
 %0A%0A  
@@ -304,19 +304,16 @@
         
-if 
 self.pc_
@@ -330,401 +330,8 @@
 sh()
-:%0A            all_apps = os.listdir(self.app_dir)%0A            print(BaseColors.GREEN + %22Loading applications...%22)%0A            time.sleep(1)%0A%0A            print(%22%5Cn%5CnAPP NUMBER%5Ct%5CtAPPLICATION NAME%22 + BaseColors.ENDCOLOR)%0A%0A            for index, app in enumerate(all_apps):%0A                if app not in self.system_files:%0A                    print (index + 1), %22%5Ct%5Ct%5Ct%22 + app.replace(%22.app%22, %22%22)
 %0A%0A  
@@ -1504,16 +1504,32 @@
 XDodger(
+%22/Applications/%22
 )%0Adodge.

Revert "Load all applications in the directory"