-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(opensearch): raise 404 on search when collection does not exist
Improved typing Code formatting fixes
- Loading branch information
1 parent
1e6d5ec
commit 82786ce
Showing
13 changed files
with
388 additions
and
318 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,9 +1,9 @@ | ||
#------------------------------------------------------------------------------- | ||
# ------------------------------------------------------------------------------ | ||
# | ||
# Project: EOxServer <http://eoxserver.org> | ||
# Authors: Fabian Schindler <[email protected]> | ||
# | ||
#------------------------------------------------------------------------------- | ||
# ------------------------------------------------------------------------------ | ||
# Copyright (C) 2013 EOX IT Services GmbH | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
@@ -23,12 +23,13 @@ | |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
#------------------------------------------------------------------------------- | ||
# ------------------------------------------------------------------------------ | ||
|
||
""" This module contains facilities to help decoding configuration files. | ||
It relies on the :mod:`ConfigParser` module for actually reading the file. | ||
""" | ||
|
||
from typing import Union | ||
import sys | ||
|
||
try: | ||
|
@@ -86,7 +87,7 @@ def __init__(self, key=None, type=None, separator=None, required=False, | |
self.section = section | ||
|
||
def fget(self, reader): | ||
|
||
section = self.section or reader.section | ||
try: | ||
if self.type is bool: | ||
|
@@ -180,7 +181,7 @@ class ExampleReader(config.Reader): | |
|
||
__metaclass__ = ReaderMetaclass | ||
|
||
section = None | ||
section: Union[str, None] = None | ||
|
||
def __init__(self, config): | ||
self._config = config |
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,9 +1,9 @@ | ||
#------------------------------------------------------------------------------- | ||
# ------------------------------------------------------------------------------ | ||
# | ||
# Project: EOxServer <http://eoxserver.org> | ||
# Authors: Fabian Schindler <[email protected]> | ||
# | ||
#------------------------------------------------------------------------------- | ||
# ------------------------------------------------------------------------------ | ||
# Copyright (C) 2015 EOX IT Services GmbH | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
@@ -23,7 +23,7 @@ | |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
#------------------------------------------------------------------------------- | ||
# ------------------------------------------------------------------------------ | ||
|
||
|
||
from itertools import chain | ||
|
@@ -74,7 +74,8 @@ def encode(self, request, collection_id, queryset, search_context): | |
namespaces.update(search_context.namespaces) | ||
ATOM = ElementMaker(namespace=ns_atom.uri, nsmap=namespaces) | ||
|
||
tree = ATOM("feed", | ||
tree = ATOM( | ||
"feed", | ||
ATOM("id", request.build_absolute_uri()), | ||
ATOM("title", "%s Search" % collection_id), | ||
ATOM("description"), | ||
|
@@ -96,7 +97,8 @@ def encode(self, request, collection_id, queryset, search_context): | |
return etree.tostring(tree, pretty_print=True) | ||
|
||
def encode_entry(self, request, collection_id, item): | ||
entry = ATOM("entry", | ||
entry = ATOM( | ||
"entry", | ||
ATOM("title", item.identifier), | ||
ATOM("id", self._create_self_link(request, collection_id, item)), | ||
DC("identifier", item.identifier), | ||
|
@@ -164,7 +166,8 @@ def encode_summary(self, request, collection_id, item): | |
'eo_om_link': eo_om_link, | ||
} | ||
|
||
return ATOM("summary", | ||
return ATOM( | ||
"summary", | ||
CDATA( | ||
render_to_string( | ||
template_name, template_params, | ||
|
Oops, something went wrong.