Skip to content

Commit d6da3a8

Browse files
committed
Fixup docs in planemo.xml.validation.
1 parent 1ac6094 commit d6da3a8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

planemo/xml/validation.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Module describing abstractions for validating XML content."""
12
import abc
23
import subprocess
34

@@ -17,18 +18,20 @@
1718

1819

1920
class XsdValidator(object):
21+
"""Class allowing validation of XML files against XSD schema."""
22+
2023
__metaclass__ = abc.ABCMeta
2124

2225
@abc.abstractmethod
2326
def validate(self, schema_path, target_path):
24-
""" Validate ``target_path`` against ``schema_path``.
27+
"""Validate ``target_path`` against ``schema_path``.
2528
2629
:return type: ValidationResult
2730
"""
2831

2932
@abc.abstractmethod
3033
def enabled(self):
31-
""" Return True iff system has dependencies for this validator.
34+
"""Return True iff system has dependencies for this validator.
3235
3336
:return type: bool
3437
"""
@@ -37,7 +40,7 @@ def enabled(self):
3740

3841

3942
class LxmlValidator(XsdValidator):
40-
""" Validate XSD files using lxml library. """
43+
"""Validate XSD files using lxml library."""
4144

4245
def validate(self, schema_path, target_path):
4346
try:
@@ -54,7 +57,7 @@ def enabled(self):
5457

5558

5659
class XmllintValidator(XsdValidator):
57-
""" Validate XSD files with the external tool xmllint. """
60+
"""Validate XSD files with the external tool xmllint."""
5861

5962
def validate(self, schema_path, target_path):
6063
command = XMLLINT_COMMAND.format(schema_path, target_path)
@@ -71,6 +74,7 @@ def enabled(self):
7174

7275

7376
def get_validator(require=True):
77+
"""Return a :class:`XsdValidator` object based on available dependencies."""
7478
for validator in VALIDATORS:
7579
if validator.enabled():
7680
return validator
@@ -79,3 +83,9 @@ def get_validator(require=True):
7983
raise Exception(INSTALL_VALIDATOR_MESSAGE)
8084

8185
return None
86+
87+
88+
__all__ = [
89+
"get_validator",
90+
"XsdValidator",
91+
]

0 commit comments

Comments
 (0)