本文整理汇总了Python中pbxproj.XcodeProject.get_files_by_name方法的典型用法代码示例。如果您正苦于以下问题:Python XcodeProject.get_files_by_name方法的具体用法?Python XcodeProject.get_files_by_name怎么用?Python XcodeProject.get_files_by_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbxproj.XcodeProject
的用法示例。
在下文中一共展示了XcodeProject.get_files_by_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGetFilesByNameWithParent
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_files_by_name [as 别名]
def testGetFilesByNameWithParent(self):
project = XcodeProject(self.obj)
files = project.get_files_by_name('file', 'group2')
self.assertEqual(files.__len__(), 2)
files = project.get_files_by_name('file', 'group3')
self.assertEqual(files.__len__(), 1)
示例2: testRemoveFileById
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_files_by_name [as 别名]
def testRemoveFileById(self):
project = XcodeProject(self.obj)
original = project.__str__()
build_files = project.add_file("file.m")
file = project.get_files_by_name('file.m')[0]
result = project.remove_file_by_id(file.get_id())
self.assertTrue(result)
self.assertEqual(project.__str__(), original)
示例3: testRemoveFileByIdFromTarget
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_files_by_name [as 别名]
def testRemoveFileByIdFromTarget(self):
project = XcodeProject(self.obj)
build_files = project.add_file("file.m")
file = project.get_files_by_name('file.m')[0]
result = project.remove_file_by_id(file.get_id(), target_name='report')
self.assertTrue(result)
self.assertIsNotNone(project.objects[file.get_id()])
self.assertEqual(project.objects.get_objects_in_section('PBXBuildFile').__len__(), 3)
self.assertEqual(project.objects.get_objects_in_section('PBXSourcesBuildPhase').__len__(), 1)
示例4: testRemoveFileByIdKeepShellScriptBuildPhases
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_files_by_name [as 别名]
def testRemoveFileByIdKeepShellScriptBuildPhases(self):
project = XcodeProject(self.obj)
project.add_run_script('ls -la')
original = project.__str__()
project.add_file("file.m")
file = project.get_files_by_name('file.m')[0]
result = project.remove_file_by_id(file.get_id())
self.assertTrue(result)
self.assertEqual(project.__str__(), original)
示例5: testGetFilesByNameWithoutName
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import get_files_by_name [as 别名]
def testGetFilesByNameWithoutName(self):
project = XcodeProject(self.obj)
files = project.get_files_by_name('file1')
self.assertEqual(files.__len__(), 2)