Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions pywps/app/Service.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def __init__(self, processes=[], cfgfiles=None):
if cfgfiles:
config.load_configuration(cfgfiles)

if config.get_config_value('server', 'file') and config.get_config_value('logging', 'level'):
if config.get_config_value('logging', 'file') and config.get_config_value('logging', 'level'):
LOGGER.setLevel(getattr(logging, config.get_config_value('logging', 'level')))
msg_fmt = '%(asctime)s] [%(levelname)s] file=%(pathname)s line=%(lineno)s module=%(module)s function=%(funcName)s %(message)s' # noqa
fh = logging.FileHandler(config.get_config_value('server', 'file'))
msg_fmt = '%(asctime)s] [%(levelname)s] file=%(pathname)s line=%(lineno)s module=%(module)s function=%(funcName)s %(message)s'
fh = logging.FileHandler(config.get_config_value('logging', 'file'))
fh.setFormatter(logging.Formatter(msg_fmt))
LOGGER.addHandler(fh)
else: # NullHandler
Expand Down Expand Up @@ -326,21 +326,22 @@ def _parse_and_execute(self, process, wps_request, uuid):
raise MissingParameterValue(
inpt.identifier, inpt.identifier)
else:
inputs = deque(maxlen=inpt.max_occurs)
inputs.append(inpt.clone())
data_inputs[inpt.identifier] = inputs

# Replace the dicts with the dict of Literal/Complex inputs
# set the input to the type defined in the process
if isinstance(inpt, ComplexInput):
data_inputs[inpt.identifier] = self.create_complex_inputs(
inpt, wps_request.inputs[inpt.identifier])
elif isinstance(inpt, LiteralInput):
data_inputs[inpt.identifier] = self.create_literal_inputs(
inpt, wps_request.inputs[inpt.identifier])
elif isinstance(inpt, BoundingBoxInput):
data_inputs[inpt.identifier] = self.create_bbox_inputs(
inpt, wps_request.inputs[inpt.identifier])
#inputs = deque(maxlen=inpt.max_occurs)
#inputs.append(inpt.clone())
#data_inputs[inpt.identifier] = inputs
pass
else:
# Replace the dicts with the dict of Literal/Complex inputs
# set the input to the type defined in the process.
if isinstance(inpt, ComplexInput):
data_inputs[inpt.identifier] = self.create_complex_inputs(
inpt, wps_request.inputs[inpt.identifier])
elif isinstance(inpt, LiteralInput):
data_inputs[inpt.identifier] = self.create_literal_inputs(
inpt, wps_request.inputs[inpt.identifier])
elif isinstance(inpt, BoundingBoxInput):
data_inputs[inpt.identifier] = self.create_bbox_inputs(
inpt, wps_request.inputs[inpt.identifier])

wps_request.inputs = data_inputs

Expand Down
7 changes: 5 additions & 2 deletions pywps/inout/formats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, GEOTIFF, WCS,'
'WCS100, WCS110, WCS20, WFS, WFS100,'
'WFS110, WFS20, WMS, WMS130, WMS110,'
'WMS100')
'WMS100,'
'TEXT, NETCDF')
FORMATS = _FORMATS(
_FORMAT('application/vnd.geo+json', '.geojson', None),
_FORMAT('application/json', '.json', None),
Expand All @@ -42,7 +43,9 @@
_FORMAT('application/x-ogc-wms', '.xml', None),
_FORMAT('application/x-ogc-wms; version=1.3.0', '.xml', None),
_FORMAT('application/x-ogc-wms; version=1.1.0', '.xml', None),
_FORMAT('application/x-ogc-wms; version=1.0.0', '.xml', None)
_FORMAT('application/x-ogc-wms; version=1.0.0', '.xml', None),
_FORMAT('text/plain', '.txt', None),
_FORMAT('application/x-netcdf', '.nc', None),
)


Expand Down
2 changes: 1 addition & 1 deletion pywps/inout/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def describe_xml(self):
literal_data_doc.append(self._describe_xml_allowedvalues())

if self.default:
doc.append(E.DefaultValue(self.default))
literal_data_doc.append(E.DefaultValue(self.default))

return doc

Expand Down
18 changes: 15 additions & 3 deletions pywps/inout/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ class ComplexOutput(basic.ComplexOutput):
:param pywps.validator.mode.MODE mode: validation mode (none to strict)
"""

def __init__(self, identifier, title, supported_formats=None,
abstract='', metadata=None, mode=MODE.NONE):
def __init__(self, identifier, title, supported_formats=None,
abstract='', metadata=None,
as_reference=False, mode=MODE.NONE):
if metadata is None:
metadata = []

Expand All @@ -109,7 +110,7 @@ def __init__(self, identifier, title, supported_formats=None,
supported_formats=supported_formats,
mode=mode)
self.metadata = metadata
self.as_reference = False
self.as_reference = as_reference

self.storage = None

Expand Down Expand Up @@ -139,6 +140,17 @@ def describe_xml(self):

return doc

def execute_xml_lineage(self):
doc = WPS.Output(
OWS.Identifier(self.identifier),
OWS.Title(self.title)
)

if self.abstract:
doc.append(OWS.Abstract(self.abstract))

return doc

def execute_xml(self):
"""Render Execute response XML node

Expand Down