示例#1
0
文件: platform.py 项目: davehunt/iris
class Platform(object):
    """Class that holds all supported operating systems (HIGH_DEF = High definition displays)."""
    WINDOWS = 'win'
    LINUX = 'linux'
    MAC = 'osx'
    ALL = get_os()
    HIGH_DEF = not (pyautogui.screenshot().size == pyautogui.size())
    SCREEN_WIDTH, SCREEN_HEIGHT = pyautogui.size()
    LOW_RES = (SCREEN_WIDTH < 1280 or SCREEN_HEIGHT < 800)
示例#2
0
    def is_windows():
        """Checks if we are running on a Windows system.

        :return: True if we are running on a Windows system, False otherwise.
        """
        return get_os() == Platform.WINDOWS
示例#3
0
    def is_mac():
        """Checks if we are running on a Mac system.

        :return: True if we are running on a Mac system, False otherwise.
        """
        return get_os() == Platform.MAC
示例#4
0
    def is_linux():
        """Checks if we are running on a Linux system.

        :return: True if we are running on a Linux system, False otherwise.
        """
        return get_os() == Platform.LINUX
示例#5
0
 def get_os():
     """Get the type of the operating system your script is running on."""
     return get_os()