예제 #1
0
파일: process.py 프로젝트: janpisl/pywps
    def test_get_input_title(self):
        """Test returning the proper input title"""

        # configure
        def donothing(*args, **kwargs):
            pass

        process = Process(donothing,
                          "process",
                          title="Process",
                          inputs=[
                              LiteralInput("length", title="Length"),
                              BoundingBoxInput("bbox", title="BBox", crss=[]),
                              ComplexInput("vector", title="Vector")
                          ],
                          outputs=[],
                          metadata=[
                              Metadata('process metadata 1',
                                       'http://example.org/1'),
                              Metadata('process metadata 2',
                                       'http://example.org/2')
                          ])
        inputs = {input.identifier: input.title for input in process.inputs}
        self.assertEqual("Length", inputs['length'])
        self.assertEqual("BBox", inputs["bbox"])
        self.assertEqual("Vector", inputs["vector"])
예제 #2
0
 def __init__(self):
     super(DoNothing,
           self).__init__(self.donothing,
                          "process",
                          title="Process",
                          abstract="Process description",
                          inputs=[
                              LiteralInput("length", title="Length"),
                              BoundingBoxInput("bbox",
                                               title="BBox",
                                               crss=[]),
                              ComplexInput("vector",
                                           title="Vector",
                                           supported_formats=[FORMATS.GML])
                          ],
                          outputs=[],
                          metadata=[
                              Metadata('process metadata 1',
                                       'http://example.org/1'),
                              Metadata('process metadata 2',
                                       'http://example.org/2')
                          ],
                          translations={
                              "fr-CA": {
                                  "title": "Processus",
                                  "abstract": "Une description"
                              }
                          })
예제 #3
0
 def __init__(self):
     super(DoNothing,
           self).__init__(self.donothing,
                          "process",
                          title="Process",
                          inputs=[
                              LiteralInput("length", title="Length"),
                              BoundingBoxInput("bbox",
                                               title="BBox",
                                               crss=[]),
                              ComplexInput("vector",
                                           title="Vector",
                                           supported_formats=[FORMATS.GML])
                          ],
                          outputs=[],
                          metadata=[
                              Metadata('process metadata 1',
                                       'http://example.org/1'),
                              Metadata('process metadata 2',
                                       'http://example.org/2')
                          ])
예제 #4
0
    def __init__(self):
        inputs = [
            LiteralInput('literal_input',
                         "Literal input title",
                         'integer',
                         "Literal input value abstract.",
                         min_occurs=0,
                         max_occurs=1,
                         uoms=['meters', 'feet'],
                         default=1),
            LiteralInput('date_input',
                         'The title is shown when no abstract is provided.',
                         'date',
                         allowed_values=['2000-01-01', '2018-01-01']),
            ComplexInput(
                'complex_input',
                'Complex input title',
                [Format('application/json'),
                 Format('application/x-netcdf')],
                abstract="Complex input abstract.",
            ),
            BoundingBoxInput('bb_input',
                             'BoundingBox input title', [
                                 'EPSG:4326',
                             ],
                             metadata=[
                                 Metadata('EPSG.io', 'http://epsg.io/'),
                             ]),
        ]
        outputs = [
            LiteralOutput(
                'literal_output',
                'Literal output title',
                'boolean',
                'Boolean output abstract.',
            ),
            ComplexOutput(
                'complex_output',
                'Complex output',
                [
                    Format('text/plain'),
                ],
            ),
            BoundingBoxOutput('bb_output', 'BoundingBox output title', [
                'EPSG:4326',
            ])
        ]

        super(DocExampleProcess, self).__init__(
            self._handler,
            identifier='doc_example_process_identifier',
            title="Process title",
            abstract="Multiline process abstract.",
            version="4.0",
            metadata=[
                Metadata('PyWPS docs', 'https://pywps.org'),
                Metadata(
                    'NumPy docstring conventions',
                    'https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt'
                )
            ],
            inputs=inputs,
            outputs=outputs,
        )