当前位置: 首页>>代码示例>>Python>>正文


Python XcodeProject.add_folder方法代码示例

本文整理汇总了Python中pbxproj.XcodeProject.add_folder方法的典型用法代码示例。如果您正苦于以下问题:Python XcodeProject.add_folder方法的具体用法?Python XcodeProject.add_folder怎么用?Python XcodeProject.add_folder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pbxproj.XcodeProject的用法示例。


在下文中一共展示了XcodeProject.add_folder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testAddFolderNonRecursive

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
    def testAddFolderNonRecursive(self):
        project = XcodeProject(self.obj)
        project.add_folder('samples/', recursive=False)

        # should add test.framework and testLibrary.a and 2 groups, samples, dirA
        samples = project.get_groups_by_name('samples')
        dirA = project.get_groups_by_name('dirA')
        dirB = project.get_groups_by_name('dirB')
        self.assertNotEqual(samples, [])
        self.assertNotEqual(dirA, [])
        self.assertEqual(dirB, [])

        self.assertEqual(samples[0].children.__len__(), 3) # dirA, test.framework, testLibrary.a
        self.assertEqual(dirA[0].children.__len__(), 0)
开发者ID:kronenthaler,项目名称:mod-pbxproj,代码行数:16,代码来源:TestProjectFiles.py

示例2: testAddFolderWithExclusions

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
    def testAddFolderWithExclusions(self):
        project = XcodeProject(self.obj)
        project.add_folder('samples', excludes=['file.\\.m', 'test.*'])

        # should add test.framework and testLibrary.a and 2 groups, samples, dirA
        samples = project.get_groups_by_name('samples')
        dirA = project.get_groups_by_name('dirA')
        dirB = project.get_groups_by_name('dirB')
        self.assertNotEqual(samples, [])
        self.assertNotEqual(dirA, [])
        self.assertNotEqual(dirB, [])

        self.assertEqual(samples[0].children.__len__(), 1)  # dirA, -test.framework, -testLibrary.a
        self.assertEqual(dirA[0].children.__len__(), 1)  # dirB, -fileA.m
        self.assertEqual(dirB[0].children.__len__(), 0)  # -fileB.m
开发者ID:kronenthaler,项目名称:mod-pbxproj,代码行数:17,代码来源:TestProjectFiles.py

示例3: testAddFolderAsReference

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
    def testAddFolderAsReference(self):
        project = XcodeProject(self.obj,path="tests/project.pbxproj")
        build_file = project.add_folder('samples', create_groups=False)

        self.assertListEqual(project.get_groups_by_name('samples'), [])
        self.assertEqual(project.objects.get_objects_in_section(u'PBXResourcesBuildPhase').__len__(), 2)
        self.assertEqual(build_file.__len__(), 2)
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: testAddFolderRecursive

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
    def testAddFolderRecursive(self):
        project = XcodeProject(self.obj)
        result = project.add_folder('samples')

        # should add test.framework and testLibrary.a and 2 groups, samples, dirA
        samples = project.get_groups_by_name('samples')
        dirA = project.get_groups_by_name('dirA')
        dirB = project.get_groups_by_name('dirB')
        self.assertNotEqual(samples, [])
        self.assertNotEqual(dirA, [])
        self.assertNotEqual(dirB, [])

        self.assertEqual(samples[0].children.__len__(), 3) # dirA, test.framework, testLibrary.a
        self.assertEqual(dirA[0].children.__len__(), 2)  # dirB, fileA.m
        self.assertEqual(dirB[0].children.__len__(), 1)  # fileB.m
开发者ID:,项目名称:,代码行数:17,代码来源:

示例5: testAddFolderNotAFolder

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
    def testAddFolderNotAFolder(self):
        project = XcodeProject(self.obj)
        result = project.add_folder('samples/testLibrary.a')

        self.assertIsNone(result)
开发者ID:,项目名称:,代码行数:7,代码来源:


注:本文中的pbxproj.XcodeProject.add_folder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。