[PATCH v3 2/4] String representation of a Folder is its name

Sebastian Spaeth Sebastian at SSpaeth.de
Sun Mar 6 19:03:05 GMT 2011

This enables us to just use the folder instance in the ui output and get
a name rather than having to call getname() all the time.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
This is not used yet here, but will be used in the ui module in patch #4.

 offlineimap/folder/Base.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py
index fb8519b..2e0b177 100644
--- a/offlineimap/folder/Base.py
+++ b/offlineimap/folder/Base.py
@@ -31,6 +31,9 @@ class BaseFolder:
         """Returns name"""
         return self.name
+    def __str__(self):
+        return self.name
     def suggeststhreads(self):
         """Returns true if this folder suggests using threads for actions;
         false otherwise.  Probably only IMAP will return true."""

More information about the OfflineIMAP-project mailing list