Skip to content
Draft
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
2 changes: 2 additions & 0 deletions emu/processes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .wps_geodata import GeoData
from .wps_pandas import Pandas
from .wps_show_defaults import ShowDefaults
from .wps_special_chars import SpecialChars


processes = [
Expand All @@ -47,4 +48,5 @@
GeoData(),
Pandas(),
ShowDefaults(),
SpecialChars(),
]
31 changes: 31 additions & 0 deletions emu/processes/wps_special_chars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from pywps import Process, LiteralInput, LiteralOutput


class SpecialChars(Process):
"""A process showing the encoding of special characters."""
def __init__(self):
inputs = [
LiteralInput('frost_days', 'Frost Days',
abstract='Maximum number of consecutive frost days (Tn < 0).',
data_type='integer')]
outputs = [
LiteralOutput('output', 'Output response',
data_type='string')]

super(SpecialChars, self).__init__(
self._handler,
identifier='special_chars',
title='<Examples with special charaters>',
version='1.0',
inputs=inputs,
outputs=outputs,
store_supported=True,
status_supported=True
)

@staticmethod
def _handler(request, response):
response.update_status('PyWPS Process started.', 0)
response.outputs['output'].data = 'Frost days: ' + request.inputs['frost_days'][0].data
response.update_status('PyWPS Process completed.', 100)
return response
1 change: 1 addition & 0 deletions tests/test_wps_caps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_wps_caps():
'show_error',
'simple_dry_run',
'sleep',
'special_chars',
'translation',
'ultimate_question',
'wordcounter',
Expand Down