[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mailman-developers
Subject:    [Mailman-Developers] Parsing templates with '%' in them?
From:       Bob Tanner <tanner () real-time ! com>
Date:       2005-11-27 3:50:51
Message-ID: dmbaeu$p9o$1 () sea ! gmane ! org
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I wanted to change the article.html template and do some CSS in it, but I
found mailman -silently- failed to parse the template files.

I've submitted the attached patch to at least log the fact the template
parsing failed.

- ----------------------- snip --------------------------------
- --- HyperArch.py        2003-12-26 14:41:30.000000000 -0600
+++ HyperArch.py-bob    2005-11-23 03:19:13.000000000 -0600
@@ -217,8 +217,9 @@
                                     Utils.GetCharSet(lang),
                                     'replace')
                 text = sdict.interpolate(utemplate)
- -        except (TypeError, ValueError):
+        except (TypeError, ValueError), e:
             # The template is really screwed up
+            syslog('error', 'The template is really screwed up: %s\n', e)
             pass
     # Make sure the text is in the given character set, or html-ify any
     # bogus
     # characters.
- ----------------------- snip --------------------------------

Next, I could not seem to isolate the "bug", but my CSS had the following
entries:

        div#main {
        margin-right: 20%;
        }
        div#menu {
        width: 15%;
        float: right;
        }

The html template parser was failing on the 20% and the 15%, looking like it
was keying off the '%' for key=value in the SafeDict class and failing.

I "solved" the problem by making the CSS an external html reference, but I
thought I'd post this info to the developer list as a FYI.


- -- 
Bob Tanner <tanner@real-time.com>          | Phone : (952)943-8700
http://www.real-time.com, Minnesota, Linux | Fax   : (952)943-8500
Key fingerprint = AB15 0BDF BCDE 4369 5B42  1973 7CF1 A709 2CC1 B288
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDiS0bfPGnCSzBsogRAjO2AJ94i5AM4VyQbMGTppwwILeygUALSwCdHpkj
mw8ylEsCQxXZzqKfSAFbxiw=
=rTtc
-----END PGP SIGNATURE-----

_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: http://mail.python.org/mailman/options/mailman-developers/mailman-developers%40progressive-comp.com


Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&amp;file=faq01.027.htp



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic