From b048ece777d97c89e8878154aa86c1eac4e20054 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 23 Jan 2020 09:32:34 +0000 Subject: [PATCH 1/2] fixed a couple of trivial typos --- docs/source/extensions/structure.rst | 4 ++-- docs/source/extensions/views.rst | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/extensions/structure.rst b/docs/source/extensions/structure.rst index ee2bc478..a289fa8b 100644 --- a/docs/source/extensions/structure.rst +++ b/docs/source/extensions/structure.rst @@ -4,7 +4,7 @@ Basic extension structure An extension starts as a simple instance of :py:class:`labthings.server.extensions.BaseExtension`. Each extension is described by a single ``BaseExtension`` instance, containing any number of methods, API views, and additional hardware components. -In order to access the currently running microscope object, use the :py:func:`labthings.server.find` function, with the argument ``"org.openflexure.microscope"``. Likewise, any new components attached by other extensions can be found using their full name, as above. +In order to access the currently running microscope object, use the :py:func:`labthings.server.find.find_component` function, with the argument ``"org.openflexure.microscope"``. Likewise, any new components attached by other extensions can be found using their full name, as above. A simple extension file, with no API views but application-available methods may look like: @@ -23,4 +23,4 @@ Once this extension is loaded, any other extensions will have access to your met # Call a function from your extension if my_found_extension: - my_found_extension.identify() \ No newline at end of file + my_found_extension.identify() diff --git a/docs/source/extensions/views.rst b/docs/source/extensions/views.rst index 7d40b82b..ea35ddd2 100644 --- a/docs/source/extensions/views.rst +++ b/docs/source/extensions/views.rst @@ -20,15 +20,15 @@ Request arguments For POST and PUT requests, data usually needs to be provided to the view in order to perform its function. In this example, our ``rename`` view requires a new microscope name to be passed. We make use of the ``@use_body`` decorator to provide this functionality. -``@use_body`` defines the type of data expected in the request body. In this example, we ``String`` type data. The arguments of ``fields.String`` allow us to provide additional information, such as the parameter being required, and example values to appear in API documentation. +``@use_body`` defines the type of data expected in the request body. In this example, we use ``String`` type data. The arguments of ``fields.String`` allow us to provide additional information, such as the parameter being required, and example values to appear in API documentation. Adding additional fields, and the meaning of the field types, will be discussed further in the next section. -When a POST request is made to our API view, the request body is converted to processed by ``@use_body``, and passed as a positional argument to our ``post`` function. +When a POST request is made to our API view, the ``@use_body`` converts the body of the request into a ``String``, and passes it as a positional argument to our ``post`` function. Swagger documentation +++++++++++++++++++++ -At this point, it is useful to introduce the automatically generated Swagger documentation. From any web browser, go to ``http://microscope.local/api/v2/swagger-ui`` (or replace ``microscope.local`` with your microscopes IP address on incompatible systems). +At this point, it is useful to introduce the automatically generated Swagger documentation. From any web browser, go to ``http://microscope.local/api/v2/swagger-ui`` (or replace ``microscope.local`` with your microscope's IP address if ``microscope.local`` doesn't work for your system). -This page uses `SwaggerUI `_ to provide visual, interactive API documentation. Find your extensions URL in the documentation under the ``extensions`` group. Basic documentation about the parameters required for your POST method should be visible, as well as an interactive example filled out with the example request given in ``@use_body``. \ No newline at end of file +This page uses `SwaggerUI `_ to provide visual, interactive API documentation. Find your extensions URL in the documentation under the ``extensions`` group. Basic documentation about the parameters required for your POST method should be visible, as well as an interactive example filled out with the example request given in ``@use_body``. From d36b82ac778a5330aeaff172db8006b8dafb368e Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Mon, 17 Feb 2020 12:26:50 +0000 Subject: [PATCH 2/2] fixed dead link to cli instructions --- docs/source/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index 767fdf19..abeaaf45 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -21,6 +21,6 @@ For offline (i.e. no real microscope connected) development, a basic development Managing the server ------------------- -Managing the server through the installer script's CLI is documented `on our website `_. +Managing the server through the installer script's CLI is documented `on our website `_. This includes starting the server as a background service, as well as starting a development server with real-time debug logging. \ No newline at end of file