als.io package¶
Submodules¶
als.io.input module¶
Provides everything need to handle ALS main inputs : images.
We need to read file and in the future, get images from INDI
-
class
als.io.input.
FolderScanner
[source]¶ Bases:
watchdog.events.FileSystemEventHandler
,als.io.input.InputScanner
,PyQt5.QtCore.QObject
Watches file changes (creation, move) in a specific filesystem folder
the watched directory is retrieved from user config on scanner startup
-
on_created
(event)[source]¶ Called when a file or directory is created.
- Parameters
event (
DirCreatedEvent
orFileCreatedEvent
) – Event representing file/directory creation.
-
-
exception
als.io.input.
InputError
[source]¶ Bases:
Exception
Base class for all Exception subclasses in this module
-
class
als.io.input.
InputScanner
[source]¶ Bases:
object
Base abstract class for all code responsible of ALS “image acquisition”.
Subclasses are responsible for :
replying to start & stop commands
reading images from actual source
creating Image objects
broadcasting every new image
-
broadcast_image
(image: als.model.base.Image)[source]¶ Send a signal with newly read image to anyone who cares
- Parameters
image (Image) – the new image
-
static
create_scanner
(scanner_type: str = 'FS')[source]¶ Factory for image scanners.
- Parameters
scanner_type (str.) –
the type of scanner to create. Accepted values are :
”FS” for a filesystem scanner
- Returns
the right scanner implementation
- Return type
InputScanner subclass
-
new_image_signal
¶ Qt signal emitted when a new image is read by scanner
-
exception
als.io.input.
ScannerStartError
[source]¶ Bases:
als.io.input.InputError
Raised when folder scanner start is in error.
-
als.io.input.
read_disk_image
(path: pathlib.Path)[source]¶ Reads an image from disk
- Parameters
path (pathlib.Path) – path to the file to load image from
- Returns
the image read from disk or None if image is ignored or an error occurred
- Return type
als.io.network module¶
Provide networking features
-
class
als.io.network.
HTTPHandler
(request, client_address, server)[source]¶ Bases:
http.server.SimpleHTTPRequestHandler
This handler uses server.base_path instead of always using os.getcwd()
-
class
als.io.network.
HTTPServer
(base_path, server_address, request_handler_class=<class 'als.io.network.HTTPHandler'>)[source]¶ Bases:
http.server.HTTPServer
The main server, you pass in base_path which is the path you want to serve requests from
-
class
als.io.network.
WebServer
(web_dir)[source]¶ Bases:
threading.Thread
Thread class with a stop() method.
The thread itself has to check regularly for the stopped() condition.
als.io.output module¶
Everything we need to perform outputs from ALS
For now, we only save some images to disk, but who knows…
-
class
als.io.output.
ImageSaver
(save_queue: als.code_utilities.SignalingQueue)[source]¶ Bases:
als.processing.QueueConsumer
Saves images according to commands posted to IMAGE_SAVE_QUEUE in its own thread
Module contents¶
Everything related to I/O in ALS