camera.controllers package

Submodules

camera.controllers.cameraconfigurationcontroller module

Controller for Cameras configuration

class camera.controllers.cameraconfigurationcontroller.CameraConfigurationController(camera: Camera)

Bases: Controller

Controller for camera configuration

add_rules(app)

Add rules

Parameters:

app (Flask) – Flask application

configuration()

Handles configuration actions based on the HTTP request method.

Returns:

json response containing the configuration data for

GET or the result of the update operation for PUT. For unsupported methods, returns a 400 error with an appropriate message.

Return type:

json

get_configuration()

Get the current cameras configuration

Returns:

json with the current configuration, or json with an error if there is an exception.

Return type:

json

put_configuration()

Set the cameras configuration according to the json included in request content

Returns:

json with the configuration to set in the pipeline, or with an error if there is an exception.

Return type:

json

camera.controllers.controller module

Base controller

class camera.controllers.controller.Controller

Bases: ABC

Flask server method controller

abstractmethod add_rules(app)

Add rules to flask server

response(data, code: int = 200, mimetype: str = 'application/json')

Builds and returns Response for a request

Parameters:
  • data – the data to be sent

  • code (int, optional) – HTTPStatus code. Defaults to 200.

  • mimetype (str, optional) – Response mimetype. Defaults to “application/json”.

Returns:

A Flask Response object with the given data.

Return type:

Flask.Response

Module contents