Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5049
Modified Files:
filter.py
Log Message:
Patch [ 1676324 ] Action texts should be localized
>From Marko von Oppen.
Index: filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** filter.py 29 Dec 2004 06:22:31 -0000 1.47
--- filter.py 8 Mar 2007 23:25:07 -0000 1.48
***************
*** 10,14 ****
--- 10,21 ----
True, False = 1, 0
+ # Action texts could be localized.
+ # So comparing the action texts should be done using the same localized text.
+ # These variables store the actions texts in the same localized form how the
+ # user sees them in the Action dropdowns from configuration dialogs
+ ACTION_MOVE, ACTION_COPY, ACTION_NONE = None, None, None
+
def filter_message(msg, mgr, all_actions=True):
+
config = mgr.config.filter
prob = mgr.score(msg)
***************
*** 32,35 ****
--- 39,47 ----
ms = mgr.message_store
try:
+ global ACTION_NONE, ACTION_COPY, ACTION_MOVE
+ if ACTION_NONE is None: ACTION_NONE = _("Untouched").lower()
+ if ACTION_COPY is None: ACTION_COPY = _("Copied").lower()
+ if ACTION_MOVE is None: ACTION_MOVE = _("Moved").lower()
+
try:
# Save the score
***************
*** 84,90 ****
if mark_as_read:
msg.SetReadState(True)
! if action.startswith("un"): # untouched
mgr.LogDebug(1, "Not touching message '%s'" % msg.subject)
! elif action.startswith("co"): # copied
try:
dest_folder = ms.GetFolder(folder_id)
--- 96,102 ----
if mark_as_read:
msg.SetReadState(True)
! if action == ACTION_NONE:
mgr.LogDebug(1, "Not touching message '%s'" % msg.subject)
! elif action == ACTION_COPY:
try:
dest_folder = ms.GetFolder(folder_id)
***************
*** 96,100 ****
mgr.LogDebug(1, "Copied message '%s' to folder '%s'" \
% (msg.subject, dest_folder.GetFQName()))
! elif action.startswith("mo"): # Moved
try:
dest_folder = ms.GetFolder(folder_id)
--- 108,112 ----
mgr.LogDebug(1, "Copied message '%s' to folder '%s'" \
% (msg.subject, dest_folder.GetFQName()))
! elif action == ACTION_MOVE:
try:
dest_folder = ms.GetFolder(folder_id)
_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins