def dump_string(self, dump_parents=False, show_xml=False):
        result=""
        result += "CREDENTIAL %s\n" % self.get_subject()
        filename=self.get_filename()
        if filename: result += "Filename %s\n"%filename
        result += "      privs: %s\n" % self.get_privileges().save_to_string()
        gidCaller = self.get_gid_caller()
        if gidCaller:
            result += "  gidCaller:\n"
            result += gidCaller.dump_string(8, dump_parents)

        if self.get_signature():
            print "  gidIssuer:"
            self.get_signature().get_issuer_gid().dump(8, dump_parents)

        if self.expiration:
            print "  expiration:", self.expiration.isoformat()

        gidObject = self.get_gid_object()
        if gidObject:
            result += "  gidObject:\n"
            result += gidObject.dump_string(8, dump_parents)

        if self.parent and dump_parents:
            result += "\nPARENT"
            result += self.parent.dump_string(True)

        if show_xml:
            try:
                tree = etree.parse(StringIO(self.xml))
                aside = etree.tostring(tree, pretty_print=True)
                result += "\nXML\n"
                result += aside
                result += "\nEnd XML\n"
            except:
                import traceback
                print "exc. Credential.dump_string / XML"
                traceback.print_exc()

        return result
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/foam/sfa/trust/credential.py/Credential.dump_string/original