mod_pbxproj.py 文件源码

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

项目:qt-xcodeproj-embeded-frameworks 作者: lukevear 项目源码 文件源码
def Load(cls, path, pure_python=False):
        if pure_python:
            import openstep_parser as osp
            tree = osp.OpenStepDecoder.ParseFromFile(open(path, 'r'))
        else:
            cls.plutil_path = os.path.join(os.path.split(__file__)[0], 'plutil')

            if not os.path.isfile(XcodeProject.plutil_path):
                cls.plutil_path = 'plutil'

            # load project by converting to xml and then convert that using plistlib
            p = subprocess.Popen([XcodeProject.plutil_path, '-convert', 'xml1', '-o', '-', path], stdout=subprocess.PIPE)
            stdout, stderr = p.communicate()

            # If the plist was malformed, return code will be non-zero
            if p.returncode != 0:
                print stdout
                return None

            tree = plistlib.readPlistFromString(stdout)

        return XcodeProject(tree, path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号