Ejemplo n.º 1
0
class DenoiseProperty(PropertyView):
    """Value of integration_time"""

    schema = fields.Int(required=True, minimum=100, maximum=500)
    semtype = "LevelProperty"

    @op.readproperty
    def get(self):
        # When a GET request is made, we'll find our attached component
        my_component = find_component("org.labthings.example.mycomponent")
        return my_component.integration_time

    @op.writeproperty
    def put(self, new_property_value):
        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")

        # Apply the new value
        my_component.integration_time = new_property_value

        return my_component.integration_time
Ejemplo n.º 2
0
 class TestSchema(Schema):
     test_regexp = fields.Int(validate=validate.Regexp(r"\d+"))
Ejemplo n.º 3
0
    class Index(ActionView):
        args = {"integer": fields.Int()}
        semtype = "ToggleAction"

        def post(self):
            return "POST"
Ejemplo n.º 4
0
    class Index(ActionView):
        schema = fields.Int()
        response_content_type = "text/plain; charset=us-ascii"

        def post(self):
            return "POST"
Ejemplo n.º 5
0
    class Index(PropertyView):
        schema = fields.Int()

        def put(self):
            return "PUT"
Ejemplo n.º 6
0
    class Index(PropertyView):
        schema = fields.Int(required=True)

        def get(self):
            return "GET"