[Spambayes-checkins] spambayes pop3proxy.py,1.40,1.41

Richie Hindle richiehindle at users.sourceforge.net
Fri Jan 24 14:45:12 EST 2003


Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv26242

Modified Files:
	pop3proxy.py 
Log Message:
You can now click on a message subject on the Review page to view
the message (thanks to Skip for the code).
Darkened the stripes on the Review page slightly (though probably not
enough for Skip's Powerbook 8-).
Spread out the radio buttons a little, so that they line up better under
their headings (without making their spacing uneven).


Index: pop3proxy.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** pop3proxy.py	24 Jan 2003 20:53:29 -0000	1.40
--- pop3proxy.py	24 Jan 2003 22:45:09 -0000	1.41
***************
*** 84,88 ****
   o Possibly integrate Tim Stone's SMTP code - make it use async, make
     the training code update (rather than replace!) the database.
-  o Allow use of the UI without the POP3 proxy.
   o Remove any existing X-Spambayes-Classification header from incoming
     emails.
--- 84,87 ----
***************
*** 95,100 ****
  Code quality:
  
-  o Make a separate Dibbler plugin for serving images, so there's no
-    duplication between pop3proxy and OptionConfig.
   o Move the UI into its own module.
   o Cope with the email client timing out and closing the connection.
--- 94,97 ----
***************
*** 557,564 ****
                 clientSocket.getpeername()[0] == clientSocket.getsockname()[0]
  
!     def _writePreamble(self, name, showImage=True):
          """Writes the HTML for the beginning of a page - time-consuming
          methlets use this and `_writePostamble` to write the page in
!         pieces, including progress messages."""
  
          # Take the whole palette and remove the content and the footer,
--- 554,562 ----
                 clientSocket.getpeername()[0] == clientSocket.getsockname()[0]
  
!     def _writePreamble(self, name, parent=None, showImage=True):
          """Writes the HTML for the beginning of a page - time-consuming
          methlets use this and `_writePostamble` to write the page in
!         pieces, including progress messages.  `parent` (if given) should
!         be a pair: `(url, label)`, eg. `('review', 'Review')`."""
  
          # Take the whole palette and remove the content and the footer,
***************
*** 574,577 ****
--- 572,578 ----
              del html.homelink
              html.pagename = "Home"
+         elif parent:
+             html.pagename = "> <a href='%s'>%s</a> > %s" % \
+                             (parent[0], parent[1], name)
          else:
              html.pagename = "> " + name
***************
*** 799,802 ****
--- 800,804 ----
              row.subject = messageInfo.subjectHeader
              row.subject.title = messageInfo.bodySummary
+             row.subject.href="view?key=%s&corpus=%s" % (key, label)
              row.from_ = messageInfo.fromHeader
              setattr(row, 'class', ['stripe_on', 'stripe_off'][stripe]) # Grr!
***************
*** 920,923 ****
--- 922,935 ----
  
          self.write(box)
+         self._writePostamble()
+ 
+     def onView(self, key, corpus):
+         """View a message - linked from the Review page."""
+         self._writePreamble("View message", parent=('review', 'Review'))
+         message = state.unknownCorpus.get(key)
+         if message:
+             self.write("<pre>%s</pre>" % cgi.escape(message.getSubstance()))
+         else:
+             self.write("<p>Can't find message %r. Maybe it expired.</p>" % key)
          self._writePostamble()
  





More information about the Spambayes-checkins mailing list