-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor using custom response object
- Loading branch information
Showing
6 changed files
with
37 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from typing import Dict | ||
from oaipmh.serializers.output_formats import Response | ||
|
||
from oaipmh.serializers.output_formats import InteriorData | ||
|
||
def get_record(params: Dict[str, str]) -> InteriorData: | ||
return | ||
def get_record(params: Dict[str, str]) -> Response: | ||
return "<a>b</a>", 200, {} | ||
|
||
def list_records(params: Dict[str, str]) -> InteriorData: | ||
return | ||
def list_records(params: Dict[str, str]) -> Response: | ||
return "<a>b</a>", 200, {} | ||
|
||
def list_identifiers(params: Dict[str, str]) -> InteriorData: | ||
return | ||
def list_identifiers(params: Dict[str, str]) -> Response: | ||
return "<a>b</a>", 200, {} |
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,11 @@ | ||
from typing import Dict | ||
from oaipmh.serializers.output_formats import InteriorData | ||
from oaipmh.serializers.output_formats import Response | ||
|
||
def identify(params: Dict[str, str]) -> InteriorData: | ||
return | ||
def identify(params: Dict[str, str]) -> Response: | ||
return "<a>b</a>", 200, {} | ||
|
||
def list_metadata_formats(params: Dict[str, str]) -> InteriorData: | ||
return | ||
def list_metadata_formats(params: Dict[str, str]) -> Response: | ||
return "<a>b</a>", 200, {} | ||
|
||
def list_sets(params: Dict[str, str]) -> InteriorData: | ||
return | ||
def list_sets(params: Dict[str, str]) -> Response: | ||
return "<a>b</a>", 200, {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from typing import Tuple, Dict, Any | ||
|
||
class InteriorData: #TODO placeholder return type | ||
value="" | ||
Response = Tuple[Dict[str, Any], int, Dict[str, Any]] |
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