tag 277310 + patch
tag 277310 - help
thanks

Hi Phil,

I believe the patch below should do; please let me know what you
think...

Cheers,

--Seb

--- /usr/share/doc/python-libgmail/examples/gmailpopd.py        2005-02-08 
12:47:09.000000000 -0800
+++ /tmp/gmailpopd.py   2005-05-09 19:12:01.641670189 -0700
@@ -191,17 +191,24 @@
         """
         """
         DUMMY_MSG_SIZE = 1 # TODO: Determine actual message size.
+        msgCount = len(snapshot.unreadMsgs)
+        self.push('+OK')
         if not arg:
             # TODO: Change all of this to operate on an account snapshot?
-            msgCount = len(snapshot.unreadMsgs)
-            self.push('+OK')
             for msgIdx in range(1, msgCount + 1):
                 self.push('%d %d' % (msgIdx, DUMMY_MSG_SIZE))
-            self.push(".")
         else:
-            # TODO: Handle per-msg LIST commands
-            raise NotImplementedError
-
+            try:
+                arg = int(arg)
+            except:
+                arg = -1
+            if 0 < arg <= msgCount:
+                self.push('%d %d' % (arg, DUMMY_MSG_SIZE))
+            else:
+                self.push("-ERR no such message, only %d messages in maildrop"
+                          % msgCount)
+        self.push(".")
+

     def pop_RETR(self, arg):
         """


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to