How to use the pbxproj.PBXGenericObject.PBXGenericObject._escape 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 / pbxproj / PBXGenericObject.py View on Github external
def _print_object(self, indentation_depth=u'', entry_separator=u'\n', object_start=u'\n',
                      indentation_increment=u'\t'):
        ret = u'{' + object_start

        for key in self.get_keys():
            value = self._format(getattr(self, key), indentation_depth, entry_separator, object_start,
                                 indentation_increment)

            # use key decorators, could simplify the generation of the comments.
            ret += indentation_depth + u'{3}{0} = {1};{2}'.format(PBXGenericObject._escape(key), value, entry_separator,
                                                                  indentation_increment)
        ret += indentation_depth + u'}'
        return ret
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