[CalendarServer-changes] [8546] CalendarServer/trunk/calendarserver/tools/shell/vfs.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 16 15:44:41 PST 2012


Revision: 8546
          http://trac.macosforge.org/projects/calendarserver/changeset/8546
Author:   wsanchez at apple.com
Date:     2012-01-16 15:44:41 -0800 (Mon, 16 Jan 2012)
Log Message:
-----------
Add __repr__ and __eq__ to File.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/shell/vfs.py

Modified: CalendarServer/trunk/calendarserver/tools/shell/vfs.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell/vfs.py	2012-01-16 21:55:14 UTC (rev 8545)
+++ CalendarServer/trunk/calendarserver/tools/shell/vfs.py	2012-01-16 23:44:41 UTC (rev 8546)
@@ -43,6 +43,15 @@
     def __str__(self):
         return "/" + "/".join(self.path)
 
+    def __repr__(self):
+        return "<%s: %s>" % (self.__class__.__name__, self)
+
+    def __eq__(self, other):
+        if isinstance(other, File):
+            return self.path == other.path
+        else:
+            return NotImplemented
+
     def describe(self):
         return succeed("%s (%s)" % (self, self.__class__.__name__))
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120116/19c55def/attachment.html>


More information about the calendarserver-changes mailing list