[Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.12, 1.13

Richie Hindle richiehindle at users.sourceforge.net
Wed Jul 2 15:10:44 EDT 2003


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

Modified Files:
	UserInterface.py 
Log Message:
Put the current date and time into the footer of the web interface,
but this time for *all* the pages.


Index: UserInterface.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** UserInterface.py	2 Jul 2003 19:28:17 -0000	1.12
--- UserInterface.py	2 Jul 2003 21:10:41 -0000	1.13
***************
*** 102,105 ****
--- 102,113 ----
                 clientSocket.getpeername()[0] == clientSocket.getsockname()[0]
  
+     def _getHTMLClone(self):
+         """Gets a clone of the HTML, with the footer timestamped, ready to be
+         modified and sent to the browser."""
+         clone = self.html.clone()
+         timestamp = time.strftime('%H:%M on %A %B %d %Y', time.localtime())
+         clone.footer.timestamp = timestamp
+         return clone
+ 
      def _writePreamble(self, name, parent=None, showImage=True):
          """Writes the HTML for the beginning of a page - time-consuming
***************
*** 110,114 ****
          # Take the whole palette and remove the content and the footer,
          # leaving the header and an empty body.
!         html = self.html.clone()
          html.mainContent = " "
          del html.footer
--- 118,122 ----
          # Take the whole palette and remove the content and the footer,
          # leaving the header and an empty body.
!         html = self._getHTMLClone()
          html.mainContent = " "
          del html.footer
***************
*** 139,145 ****
      def _writePostamble(self):
          """Writes the end of time-consuming pages - see `_writePreamble`."""
!         footer = self.html.footer.clone()
!         footer.timestamp = time.strftime('%H:%M on %A %B %d %Y', time.localtime())
!         self.write("</div>" + footer)
          self.write("</body></html>")
  
--- 147,151 ----
      def _writePostamble(self):
          """Writes the end of time-consuming pages - see `_writePreamble`."""
!         self.write("</div>" + self._getHTMLClone().footer)
          self.write("</body></html>")
  
***************
*** 364,368 ****
      def onConfig(self):
          # Start with an empty config form then add the sections.
!         html = self.html.clone()
          # "Save and Shutdown" is confusing here - it means "Save database"
          # but that's not clear.
--- 370,374 ----
      def onConfig(self):
          # Start with an empty config form then add the sections.
!         html = self._getHTMLClone()
          # "Save and Shutdown" is confusing here - it means "Save database"
          # but that's not clear.
***************
*** 491,495 ****
          if parms.has_key("how"):
              del parms["how"]
!         html = self.html.clone()
          html.shutdownTableCell = "&nbsp;"
          html.mainContent = self.html.headedBox.clone()
--- 497,501 ----
          if parms.has_key("how"):
              del parms["how"]
!         html = self._getHTMLClone()
          html.shutdownTableCell = "&nbsp;"
          html.mainContent = self.html.headedBox.clone()
***************
*** 531,535 ****
          self.reReadOptions()
  
!         html = self.html.clone()
          html.shutdownTableCell = "&nbsp;"
          html.mainContent = self.html.headedBox.clone()
--- 537,541 ----
          self.reReadOptions()
  
!         html = self._getHTMLClone()
          html.shutdownTableCell = "&nbsp;"
          html.mainContent = self.html.headedBox.clone()





More information about the Spambayes-checkins mailing list