diff --git a/pywps/app/Service.py b/pywps/app/Service.py index bf865e3d8..c340f936e 100644 --- a/pywps/app/Service.py +++ b/pywps/app/Service.py @@ -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 @@ -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 diff --git a/pywps/inout/formats/__init__.py b/pywps/inout/formats/__init__.py index a1a4e746d..54d4ac5e9 100644 --- a/pywps/inout/formats/__init__.py +++ b/pywps/inout/formats/__init__.py @@ -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), @@ -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), ) diff --git a/pywps/inout/inputs.py b/pywps/inout/inputs.py index 73e718268..98b466965 100644 --- a/pywps/inout/inputs.py +++ b/pywps/inout/inputs.py @@ -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 diff --git a/pywps/inout/outputs.py b/pywps/inout/outputs.py index ed8822fe9..f33f4be6b 100644 --- a/pywps/inout/outputs.py +++ b/pywps/inout/outputs.py @@ -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 = [] @@ -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 @@ -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