-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
231 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from .base import BaseHandler | ||
from ...utils import get_subclasses | ||
from ... import get_registered_validators | ||
|
||
|
||
class ValidatorListHandler(BaseHandler): | ||
def get(self): | ||
data = [] | ||
validators = get_registered_validators() | ||
for cls in validators: | ||
|
||
if isinstance(cls.__doc__, str): | ||
description = cls.__doc__.split("\f")[0].strip() | ||
else: | ||
description = "" | ||
row = dict( | ||
name=cls.__name__, | ||
module_path=cls.module_path(), | ||
schema=cls.to_schema(), | ||
description=description, | ||
) | ||
data.append(row) | ||
result = dict( | ||
records=data | ||
) | ||
self.json(result) | ||
return | ||
|
||
def post(self): | ||
return self.get() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from .handlers import watchtower, data_loader | ||
from .handlers import watchtower, data_loader, validator | ||
|
||
URLS = [ | ||
(r"/", data_loader.DataLoaderListHandler), | ||
(r"/", validator.ValidatorListHandler), | ||
(r"/data_watchtower/v1/watchtower", watchtower.WatchtowerHandler), | ||
(r"/data_watchtower/v1/watchtowers", watchtower.WatchtowerListHandler), | ||
(r"/data_watchtower/v1/data_loaders", data_loader.DataLoaderListHandler), | ||
(r"/data_watchtower/v1/validators", validator.ValidatorListHandler), | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from .data_loaders import get_registered_data_loader_maps, get_registered_data_loaders | ||
from .validators import get_registered_validators, get_registered_validator_maps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.