Fixed items noticed during the upgrade to Feisty

* dependency on non-spec compliant feature of xsltproc
 * workaround Python 2.5 regression (bug 1704790)
 * make Genshi message initial-caps
This commit is contained in:
Sam Ruby 2007-04-21 16:33:47 -04:00
parent 4109e1ac17
commit f8cdb907a8
4 changed files with 32 additions and 19 deletions

View File

@ -1,14 +1,13 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">
exclude-result-prefixes="xhtml">
<!-- insert search form --> <!-- insert search form -->
<xsl:template match="xhtml:div[@id='sidebar']"> <xsl:template match="xhtml:div[@id='sidebar']">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="@*|node()"/> <xsl:apply-templates select="@*|node()"/>
<xhtml:h2>Search</xhtml:h2> <h2>Search</h2>
<xhtml:form><xhtml:input name="q"/></xhtml:form> <form><input name="q"/></form>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
@ -30,7 +29,7 @@
<xsl:template match="xhtml:head"> <xsl:template match="xhtml:head">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="@*|node()"/> <xsl:apply-templates select="@*|node()"/>
<xhtml:link rel="search" type="application/opensearchdescription+xml" title="{xhtml:link[@rel='alternate']/@title} search"> <link rel="search" type="application/opensearchdescription+xml" title="{xhtml:link[@rel='alternate']/@title} search">
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:call-template name="baseuri"> <xsl:call-template name="baseuri">
<xsl:with-param name="string"> <xsl:with-param name="string">
@ -39,7 +38,7 @@
</xsl:call-template> </xsl:call-template>
<xsl:text>opensearchdescription.xml</xsl:text> <xsl:text>opensearchdescription.xml</xsl:text>
</xsl:attribute> </xsl:attribute>
</xhtml:link> </link>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>

View File

@ -17,6 +17,6 @@ class GenshiFilterTests(unittest.TestCase):
try: try:
import genshi import genshi
except: except:
logger.warn("genshi is not available => can't test genshi filters") logger.warn("Genshi is not available => can't test genshi filters")
for method in dir(GenshiFilterTests): for method in dir(GenshiFilterTests):
if method.startswith('test_'): delattr(GenshiFilterTests,method) if method.startswith('test_'): delattr(GenshiFilterTests,method)

View File

@ -28,10 +28,16 @@ try:
import libxslt import libxslt
except: except:
try: try:
from subprocess import Popen, PIPE try:
xsltproc=Popen(['xsltproc','--version'],stdout=PIPE,stderr=PIPE) # Python 2.5 bug 1704790 workaround (alas, Unix only)
xsltproc.communicate() import commands
if xsltproc.returncode != 0: raise ImportError if commands.getstatusoutput('xsltproc --version')[0] != 0:
raise ImportError
except:
from subprocess import Popen, PIPE
xsltproc=Popen(['xsltproc','--version'],stdout=PIPE,stderr=PIPE)
xsltproc.communicate()
if xsltproc.returncode != 0: raise ImportError
except: except:
logger.warn("libxslt is not available => can't test xslt filters") logger.warn("libxslt is not available => can't test xslt filters")
del XsltFilterTests.test_xslt_filter del XsltFilterTests.test_xslt_filter

View File

@ -133,14 +133,22 @@ class FilterTests(unittest.TestCase):
try: try:
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
_no_sed = False _no_sed = True
try: if _no_sed:
sed = Popen(['sed','--version'],stdout=PIPE,stderr=PIPE) try:
sed.communicate() # Python 2.5 bug 1704790 workaround (alas, Unix only)
if sed.returncode != 0: import commands
_no_sed = True if commands.getstatusoutput('sed --version')[0]==0: _no_sed = False
except WindowsError: except:
_no_sed = True pass
if _no_sed:
try:
sed = Popen(['sed','--version'],stdout=PIPE,stderr=PIPE)
sed.communicate()
if sed.returncode == 0: _no_sed = False
except WindowsError:
pass
if _no_sed: if _no_sed:
logger.warn("sed is not available => can't test stripAd_yahoo") logger.warn("sed is not available => can't test stripAd_yahoo")