How to use the pbxproj.PBXKey.PBXKey function in pbxproj

To help you get started, we’ve selected a few pbxproj examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kronenthaler / mod-pbxproj / tests / TestPBXKey.py View on Github external
def testGetComment(self):
        key = PBXKey("123", None)
        key._get_comment = lambda: "comment"

        self.assertEqual(key.__repr__(), "123 /* comment */")
github kronenthaler / mod-pbxproj / tests / TestPBXGenericObject.py View on Github external
def testGetItem(self):
        obj = {"a": "varA", "b": [1, 2, 3], "c": {"c1": "FDDF6A571C68E5B100D7A645"}}
        dobj = PBXGenericObject().parse(obj)

        self.assertIsInstance(dobj["c"]["c1"], PBXKey)
        self.assertIsNone(dobj['X'])
github kronenthaler / mod-pbxproj / tests / TestPBXGenericObject.py View on Github external
def testParseKey(self):
        obj = "FDDF6A571C68E5B100D7A645"
        dobj = PBXGenericObject().parse(obj)

        self.assertIsInstance(dobj, PBXKey)
github kronenthaler / mod-pbxproj / pbxproj / PBXGenericObject.py View on Github external
def _parse_string(self, obj):
        if re.match('([0-9A-F]{24})', obj) is not None:
            return PBXKey(obj, self)

        return obj
github kronenthaler / mod-pbxproj / pbxproj / PBXGenericObject.py View on Github external
def _format(self, value, indentation_depth=u'', entry_separator=u'\n', object_start=u'\n',
                indentation_increment=u'\t'):
        if hasattr(value, u'_print_object'):
            value = value._print_object(indentation_depth + indentation_increment,
                                        entry_separator,
                                        object_start,
                                        indentation_increment)
        elif isinstance(value, list):
            value = self._print_list(value, indentation_depth + indentation_increment,
                                     entry_separator,
                                     object_start,
                                     indentation_increment)
        elif isinstance(value, PBXKey):
            value = value.__repr__()
        else:
            value = PBXGenericObject._escape(value.__str__(), exclude=[u"\'"])

        return value