------------------------------------------------------------
revno: 1035
committer: Barry Warsaw <[EMAIL PROTECTED]>
branch nick: 2.1
timestamp: Fri 2008-01-25 10:18:55 -0500
message:
  Merge trunk's Decorate patch.
modified:
  Mailman/Handlers/Decorate.py
    ------------------------------------------------------------
    revno: 1033.1.1
    committer: Barry Warsaw <[EMAIL PROTECTED]>
    branch nick: 2.1
    timestamp: Wed 2008-01-16 13:30:35 -0500
    message:
      Allow us to pass in extra decoration (i.e. header/footer) data via the 
message
      metadata.   Specifically, if the metadata has a 'decoration-data' key, the
      value should be a dictionary with extra interpolation keys.
      
      Also fix a bug in the way the 'extradict' default value is passwed to
      decorate.  This should never be a mutable object.
    modified:
      Mailman/Handlers/Decorate.py

=== modified file 'Mailman/Handlers/Decorate.py'
--- a/Mailman/Handlers/Decorate.py      2007-05-08 03:16:04 +0000
+++ b/Mailman/Handlers/Decorate.py      2008-01-16 18:30:35 +0000
@@ -65,6 +65,7 @@
         except Errors.NotAMemberError:
             pass
     # These strings are descriptive for the log file and shouldn't be i18n'd
+    d.update(msgdata.get('decoration-data', {}))
     header = decorate(mlist, mlist.msg_header, 'non-digest header', d)
     footer = decorate(mlist, mlist.msg_footer, 'non-digest footer', d)
     # Escape hatch if both the footer and header are empty
@@ -193,7 +194,7 @@
 
 
 
-def decorate(mlist, template, what, extradict={}):
+def decorate(mlist, template, what, extradict=None):
     # `what' is just a descriptive phrase used in the log message
     #
     # BAW: We've found too many situations where Python can be fooled into
@@ -213,7 +214,8 @@
                   'info'          : mlist.info,
                   'cgiext'        : mm_cfg.CGIEXT,
                   })
-    d.update(extradict)
+    if extradict is not None:
+        d.update(extradict)
     # Using $-strings?
     if getattr(mlist, 'use_dollar_strings', 0):
         template = Utils.to_percent(template)



--
Stable, maintained release series
https://code.launchpad.net/~mailman-coders/mailman/2.1

You are receiving this branch notification because you are subscribed to it.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to