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


Python XcodeProject.get_groups_by_name方法代码示例

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


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

示例1: testAddFolderNonRecursive

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_groups_by_name [as 别名]
    def testAddFolderNonRecursive(self):
        project = XcodeProject(self.obj)
        result = 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:,项目名称:,代码行数:16,代码来源:

示例2: testAddFolderWithExclusions

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_groups_by_name [as 别名]
    def testAddFolderWithExclusions(self):
        project = XcodeProject(self.obj)
        result = 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:,项目名称:,代码行数:17,代码来源:

示例3: testAddFolderRecursive

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_groups_by_name [as 别名]
    def testAddFolderRecursive(self):
        project = XcodeProject(self.obj)
        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:kronenthaler,项目名称:mod-pbxproj,代码行数:17,代码来源:TestProjectFiles.py

示例4: testAddFolderAsReference

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_groups_by_name [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,代码来源:

示例5: testGetGroupsByNameFromParent

# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_groups_by_name [as 别名]
    def testGetGroupsByNameFromParent(self):
        project = XcodeProject(self.obj)
        groups = project.get_groups_by_name('app', parent=project.objects['1'])

        self.assertIn(project.objects['2'], groups)
        self.assertIn(project.objects['3'], groups)
        self.assertNotIn(project.objects['5'], groups)
        self.assertNotIn(project.objects['6'], groups)
开发者ID:,项目名称:,代码行数:10,代码来源:


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