Changeset 2701
- Timestamp:
- 10/25/07 03:51:27 (1 year ago)
- Files:
-
- clientsplugin/0.11/cron/changes.xslt (modified) (1 diff)
- clientsplugin/0.11/cron/send-client-email (modified) (5 diffs)
- clientsplugin/0.11/cron/summary.xslt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
clientsplugin/0.11/cron/changes.xslt
r2698 r2701 3 3 <xsl:stylesheet 4 4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 xmlns:dt="http://xsltsl.org/date-time"6 xmlns:str="http://xsltsl.org/string"7 xmlns:hack='http://hack.com/hack'8 xsl:exclude-result-prefixes='hack'9 5 version="1.0"> 10 11 <xsl:import href="xsltsl/stdlib.xsl"/> 6 12 7 <xsl:output method="html" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/> 13 8 <xsl:decimal-format name="GBP" decimal-separator="." grouping-separator=","/> 14 9 15 <!-- Disabled until http://bugzilla.gnome.org/show_bug.cgi?id=489854 is fixed 16 <xsl:param name="view" /> --> 17 <xsl:variable name="view" select="hack:hack()"/> 10 <xsl:param name="view" /> 18 11 19 12 <!-- Match the root of the XML render the three views --> clientsplugin/0.11/cron/send-client-email
r2699 r2701 61 61 62 62 63 ## Hideous hack to work around libxslt-python 1.1.22 bug64 ## http://bugzilla.gnome.org/show_bug.cgi?id=48985465 xslthackview = 'plain'66 def fxslthackview(ctx):67 global xslthackview68 69 #70 # Small check to verify the context is correcly accessed71 #72 try:73 pctxt = libxslt.xpathParserContext(_obj=ctx)74 ctxt = pctxt.context()75 tctxt = ctxt.transformContext()76 nodeName = tctxt.insertNode().name77 except:78 pass79 80 return xslthackview81 82 libxslt.registerExtModuleFunction('hack', 'http://hack.com/hack', fxslthackview)83 ## End Hack84 85 63 class SendClientMailer(object): 86 64 def __init__(self, env): … … 89 67 90 68 def Send(self, subject, addresses, info, formatter): 91 global xslthackview92 69 if not self.config.getbool('notification', 'smtp_enabled'): 93 70 return … … 134 111 135 112 136 # This should use XSLT params... but it's b0rken137 113 view = 'plain' 138 xslthackview = view 139 result = formatter.applyStylesheet(info, None) 114 result = formatter.applyStylesheet(info, {'view': '"%s"' % view }) 140 115 msg_text = MIMEText(formatter.saveResultToString(result), view, 'utf-8') 141 116 msg_alternative.attach(msg_text) … … 143 118 144 119 view = 'html' 145 xslthackview = view 146 result = formatter.applyStylesheet(info, None) 120 result = formatter.applyStylesheet(info, {'view': '"%s"' % view }) 147 121 msg_text = MIMEText(formatter.saveResultToString(result), view, 'utf-8') 148 122 msg_alternative.attach(msg_text) … … 151 125 # Handle image embedding... 152 126 view = 'images' 153 xslthackview = view 154 result = formatter.applyStylesheet(info, None) 127 result = formatter.applyStylesheet(info, {'view': '"%s"' % view }) 155 128 if result and result.children and result.children.children: 156 129 for img in result.children.children: clientsplugin/0.11/cron/summary.xslt
r2697 r2701 3 3 <xsl:stylesheet 4 4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 xmlns:dt="http://xsltsl.org/date-time"6 xmlns:str="http://xsltsl.org/string"7 xmlns:hack='http://hack.com/hack'8 xsl:exclude-result-prefixes='hack'9 5 version="1.0"> 10 11 <xsl:import href="xsltsl/stdlib.xsl"/> 6 12 7 <xsl:output method="html" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/> 13 8 <xsl:decimal-format name="GBP" decimal-separator="." grouping-separator=","/> 14 9 15 <!-- Disabled until http://bugzilla.gnome.org/show_bug.cgi?id=489854 is fixed 16 <xsl:param name="view" /> --> 17 <xsl:variable name="view" select="hack:hack()"/> 10 <xsl:param name="view" /> 18 11 19 12 <!-- Match the root of the XML render the three views -->
