projects
/
htsworkflow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6f7980
)
Move loading DTD into a function as the call caused a hang when loaded into wsgi
author
Diane Trout
<diane@caltech.edu>
Tue, 17 Dec 2013 19:11:04 +0000
(11:11 -0800)
committer
Diane Trout
<diane@caltech.edu>
Tue, 17 Dec 2013 19:11:04 +0000
(11:11 -0800)
htsworkflow/util/ethelp.py
patch
|
blob
|
history
diff --git
a/htsworkflow/util/ethelp.py
b/htsworkflow/util/ethelp.py
index 7398963999bfa470e7ffb9ee17822a4a8bc7ddd4..f2f3e019b20782146c0855f32a4e41e02468336e 100644
(file)
--- a/
htsworkflow/util/ethelp.py
+++ b/
htsworkflow/util/ethelp.py
@@
-5,11
+5,6
@@
import os
LOGGER = logging.getLogger(__name__)
import lxml.etree
LOGGER = logging.getLogger(__name__)
import lxml.etree
-try:
- XHTML_RDF_DTD = lxml.etree.DTD(external_id='-//W3C//DTD XHTML+RDFa 1.0//EN')
-except lxml.etree.DTDParseError as e:
- XHTML_RDF_DTD = None
- LOGGER.warn("Unable to load XHTML DTD %s" % (str(e),))
def indent(elem, level=0):
"""
def indent(elem, level=0):
"""
@@
-49,8
+44,11
@@
def validate_xhtml(html, base_url='http://localhost'):
Returns True if it passed validation
and False if it fails.
"""
Returns True if it passed validation
and False if it fails.
"""
- if XHTML_RDF_DTD is None:
- return None
+ try:
+ XHTML_RDF_DTD = lxml.etree.DTD(external_id='-//W3C//DTD XHTML+RDFa 1.0//EN')
+ except lxml.etree.DTDParseError as e:
+ LOGGER.warn("Unable to load XHTML DTD %s" % (str(e),))
+ return
try:
root = lxml.etree.fromstring(html, base_url=base_url)
try:
root = lxml.etree.fromstring(html, base_url=base_url)