factory.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Stitch 作者: nathanlopez 项目源码 文件源码
def mss(*args, **kwargs):
    ''' Factory returning a proper MSS class instance.

        It detects the plateform we are running on
        and choose the most adapted mss_class to take
        screenshots.

        It then proxies its arguments to the class for
        instantiation.
    '''

    operating_system = system().lower()
    if operating_system == 'darwin':
        from .darwin import MSS
    elif operating_system == 'linux':
        from .linux import MSS
    elif operating_system == 'windows':
        from .windows import MSS
    else:
        err = 'System "{0}" not implemented.'.format(operating_system)
        raise ScreenshotError(err)

    return MSS(*args, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号