Skip to content

Commit

Permalink
Merge pull request #1412 from scieloorg/beta
Browse files Browse the repository at this point in the history
Incoporação de códigos estáveis.
  • Loading branch information
gustavofonseca authored Apr 27, 2017
2 parents 088b712 + 918ab58 commit f754225
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ yuicompressor
jsonfield
django-tastypie==0.9.16
django-htmlmin==0.7.0
packtools==1.3.3
packtools==2.0.1
celery==3.1.25
django-celery==3.1.16
defusedxml==0.4.1
Expand Down
8 changes: 7 additions & 1 deletion scielomanager/validator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ def analyze_xml(file, extra_schematron=None):
"""Analyzes `file` against packtools' XMLValidator.
"""
result = err = None
if extra_schematron:
extra_sch = packtools.utils.get_schematron_from_filepath(
extra_schematron)
extra_sch = [extra_sch]
else:
extra_sch = None

try:
xml = packtools.XMLValidator.parse(file,
extra_schematron=extra_schematron)
extra_sch_schemas=extra_sch)

except (lxml.etree.XMLSyntaxError, IOError, ValueError,
packtools.exceptions.XMLDoctypeError) as e:
Expand Down

0 comments on commit f754225

Please sign in to comment.