From 5d26d3e5f6fd0c5ea8e254b253e22d86b5e14e6a Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 4 Nov 2011 18:33:27 -0400 Subject: [PATCH] added repr, eq, neq methods to Tile class --- overviewer_core/quadtree.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/overviewer_core/quadtree.py b/overviewer_core/quadtree.py index 1fce09b..c0d511a 100644 --- a/overviewer_core/quadtree.py +++ b/overviewer_core/quadtree.py @@ -597,7 +597,16 @@ class Tile(object): """ self.col = col self.row = row - self.path = path + self.path = tuple(path) + + def __repr__(self): + return "%s(%r,%r,%r)" % (self.__class__.__name__, self.col, self.row, self.path) + + def __eq__(self,other): + return self.col == other.col and self.row == other.row and tuple(self.path) == tuple(other.path) + + def __ne__(self, other): + return not self == other @classmethod def from_path(cls, path):