Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/spambayes

Modified Files:
        ImapUI.py UserInterface.py 
Log Message:
Add support for i18n.

Index: ImapUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ImapUI.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** ImapUI.py   13 Oct 2004 02:42:04 -0000      1.39
--- ImapUI.py   21 Dec 2004 23:08:51 -0000      1.40
***************
*** 110,114 ****
  class IMAPUserInterface(UserInterface.UserInterface):
      """Serves the HTML user interface for the proxies."""
!     def __init__(self, cls, imap, pwd, imap_session_class):
          global parm_map
          # Only offer SSL if it is available
--- 110,115 ----
  class IMAPUserInterface(UserInterface.UserInterface):
      """Serves the HTML user interface for the proxies."""
!     def __init__(self, cls, imap, pwd, imap_session_class,
!                  lang_manager=None):
          global parm_map
          # Only offer SSL if it is available
***************
*** 121,125 ****
          else:
              del IMAP4_SSL
!         UserInterface.UserInterface.__init__(self, cls, parm_map, adv_map)
          self.classifier = cls
          self.imap = imap
--- 122,127 ----
          else:
              del IMAP4_SSL
!         UserInterface.UserInterface.__init__(self, cls, parm_map, adv_map,
!                                              lang_manager)
          self.classifier = cls
          self.imap = imap

Index: UserInterface.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** UserInterface.py    21 Dec 2004 21:37:06 -0000      1.49
--- UserInterface.py    21 Dec 2004 23:08:51 -0000      1.50
***************
*** 133,138 ****
  
  class BaseUserInterface(Dibbler.HTTPPlugin):
!     def __init__(self):
          Dibbler.HTTPPlugin.__init__(self)
          htmlSource, self._images = self.readUIResources()
          self.html = PyMeldLite.Meld(htmlSource, readonly=True)
--- 133,139 ----
  
  class BaseUserInterface(Dibbler.HTTPPlugin):
!     def __init__(self, lang_manager=None):
          Dibbler.HTTPPlugin.__init__(self)
+         self.lang_manager = lang_manager
          htmlSource, self._images = self.readUIResources()
          self.html = PyMeldLite.Meld(htmlSource, readonly=True)
***************
*** 250,257 ****
      def readUIResources(self):
          """Returns ui.html and a dictionary of Gifs."""
! 
!         # Using `exec` is nasty, but I couldn't figure out a way of making
!         # `getattr` or `__import__` work with ResourcePackage.
!         from spambayes.resources import ui_html
          images = {}
          for baseName in IMAGES:
--- 251,258 ----
      def readUIResources(self):
          """Returns ui.html and a dictionary of Gifs."""
!         if self.lang_manager:
!             ui_html = self.lang_manager.import_ui_html()
!         else:
!             from spambayes.resources import ui_html
          images = {}
          for baseName in IMAGES:
***************
*** 265,271 ****
      """Serves the HTML user interface."""
  
!     def __init__(self, bayes, config_parms=(), adv_parms=()):
          """Load up the necessary resources: ui.html and helmet.gif."""
!         BaseUserInterface.__init__(self)
          self.classifier = bayes
          self.parm_ini_map = config_parms
--- 266,273 ----
      """Serves the HTML user interface."""
  
!     def __init__(self, bayes, config_parms=(), adv_parms=(),
!                  lang_manager=None):
          """Load up the necessary resources: ui.html and helmet.gif."""
!         BaseUserInterface.__init__(self, lang_manager)
          self.classifier = bayes
          self.parm_ini_map = config_parms

_______________________________________________
Spambayes-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to