Description: update the protocoltreenode file.
Author: Tarek Galal <tare2.galal@gmail.com>
Reviewed-by: Joao Eriberto Mota Filho <eriberto@debian.org>
Origin: https://github.com/tgalal/yowsup/tree/legacy
Last-Update: 2014-12-02
Index: yowsup-0.0~git20140314.938cf1/src/Yowsup/ConnectionIO/protocoltreenode.py
===================================================================
--- yowsup-0.0~git20140314.938cf1.orig/src/Yowsup/ConnectionIO/protocoltreenode.py
+++ yowsup-0.0~git20140314.938cf1/src/Yowsup/ConnectionIO/protocoltreenode.py
@@ -33,21 +33,21 @@ class ProtocolTreeNode():
 		self.children = children;
 		self.data = data
 		
-	def toString(self):
+	def toString(self, depth = 0):
 		try:
-			out = "<"+self.tag;
+			out = (" " * depth) + "<"+self.tag;
 			if self.attributes is not None:
 				for key,val in self.attributes.items():
 					out+= " "+key+'="'+val+'"'
 			out+= ">\n";
 			if self.data is not None:
-				out += self.data;
+				out += (" " * (depth + 4)) + self.data.encode("hex") + "\n"
 			
 			if self.children is not None:
 				for c in self.children:
-					out+=c.toString();
+					out+=c.toString(depth + 4);
 			#print sel
-			out+= "</"+self.tag+">\n"
+			out+= (" " * depth) + "</"+self.tag+">\n"
 			return out
 		except TypeError:
 			print("ignored toString call, probably encountered byte")
