[Spambayes-checkins] spambayes/spambayes ProxyUI.py, 1.26, 1.27 UserInterface.py, 1.26, 1.27

Tony Meyer anadelonbrin at users.sourceforge.net
Mon Sep 29 03:26:30 EDT 2003


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

Modified Files:
	ProxyUI.py UserInterface.py 
Log Message:
Add a basic 'help' link to the web interface, which can be
a standard set of information, or specific to the page on
which the user clicked 'help'.  The actual help information
still needs to be added!

Index: ProxyUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** ProxyUI.py	24 Sep 2003 05:28:53 -0000	1.26
--- ProxyUI.py	29 Sep 2003 07:26:28 -0000	1.27
***************
*** 560,564 ****
  
          self.write(box)
!         self._writePostamble()
  
      def _contains(self, a, b, ignore_case=False):
--- 560,564 ----
  
          self.write(box)
!         self._writePostamble(help_topic="review")
  
      def _contains(self, a, b, ignore_case=False):

Index: UserInterface.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** UserInterface.py	24 Sep 2003 05:28:53 -0000	1.26
--- UserInterface.py	29 Sep 2003 07:26:28 -0000	1.27
***************
*** 22,25 ****
--- 22,26 ----
    onConfig - present the appropriate configuration page
    onAdvancedconfig - present the appropriate advanced configuration page
+   onHelp - present the help page
  
  To Do:
***************
*** 83,87 ****
  from Options import options, optionsPathname, defaults, OptionsClass
  
! IMAGES = ('helmet', 'status', 'config',
            'message', 'train', 'classify', 'query')
  
--- 84,88 ----
  from Options import options, optionsPathname, defaults, OptionsClass
  
! IMAGES = ('helmet', 'status', 'config', 'help',
            'message', 'train', 'classify', 'query')
  
***************
*** 133,137 ****
          return False
  
!     def _getHTMLClone(self):
          """Gets a clone of the HTML, with the footer timestamped, and
          version information added, ready to be modified and sent to the
--- 134,138 ----
          return False
  
!     def _getHTMLClone(self, help_topic=None):
          """Gets a clone of the HTML, with the footer timestamped, and
          version information added, ready to be modified and sent to the
***************
*** 141,144 ****
--- 142,147 ----
          clone.footer.timestamp = timestamp
          clone.footer.version = Version.get_version_string(self.app_for_version)
+         if help_topic:
+             clone.helplink.href = "help?topic=%s" % (help_topic,)
          return clone
  
***************
*** 178,184 ****
          self.write(re.sub(r'</div>\s*</body>\s*</html>', '', str(html)))
  
!     def _writePostamble(self):
          """Writes the end of time-consuming pages - see `_writePreamble`."""
!         self.write("</div>" + self._getHTMLClone().footer)
          self.write("</body></html>")
  
--- 181,187 ----
          self.write(re.sub(r'</div>\s*</body>\s*</html>', '', str(html)))
  
!     def _writePostamble(self, help_topic=None):
          """Writes the end of time-consuming pages - see `_writePreamble`."""
!         self.write("</div>" + self._getHTMLClone(help_topic).footer)
          self.write("</body></html>")
  
***************
*** 887,888 ****
--- 890,911 ----
  
          options.update_file(optionsPathname)
+ 
+     def onHelp(self, topic=None):
+         self._writePreamble("Help")
+         helppage = self.html.helppage.clone()
+         if topic:
+             # Present help specific to a certain page.  We probably want to
+             # load this from a file, rather than fill up UserInterface.py,
+             # but for demonstration purposes, do this for now.
+             if topic == "review":
+                 helppage.helpheader = "Review Page Help"
+                 helppage.helptext = "This page lists messages that have " \
+                                     "arrived in the last %s days and that " \
+                                     "have not yet been trained.  You should " \
+                                     "go through the messages, correcting " \
+                                     "the classification where necessary, " \
+                                     "and then click train, to train " \
+                                     "SpamBayes with these messages" \
+                                     % (options["Storage", "cache_expiry_days"],)
+         self.write(helppage)
+         self._writePostamble()





More information about the Spambayes-checkins mailing list