Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __repr__(self):
return u'// !$*UTF8*$!\n' + super(XcodeProject, self).__repr__()
def testGetComment(self):
obj = {
'objects': {
'1': {"isa": "PBXBuildFile", "name": "something", 'fileRef': 'FDDF6A571C68E5B100D7A645'},
'FDDF6A571C68E5B100D7A645': {'isa': 'PBXFileReference', "name": "real name"},
"X": {'isa': 'phase', 'name': 'X', 'files': ['1']}
}
}
dobj = XcodeProject().parse(obj)
self.assertEqual(dobj.objects['1']._get_comment(), "real name in X")
def testGetCommentForNonExistentRef(self):
obj = {
'objects': {
'FDDF6A571C68E5B100D7A645': {'isa': 'PBXBuildFile'},
"X": {'isa': 'phase', 'name': 'X', 'files': ['FDDF6A571C68E5B100D7A645']}
}
}
dobj = XcodeProject().parse(obj)
self.assertEqual(dobj.objects['FDDF6A571C68E5B100D7A645']._get_comment(), "(null) in X")
def open_project(args):
if os.path.isdir(args[u'']):
args[u''] += u"/project.pbxproj"
if not os.path.isfile(args[u'']):
raise Exception(u'Project file not found')
return XcodeProject.load(args[u''])
def load(cls, path):
import openstep_parser as osp
tree = osp.OpenStepDecoder.ParseFromFile(open(path, 'r'))
return XcodeProject(tree, path)