service.preclass.main module
- class service.preclass.main.PRECLASS_MAIN[source]
Bases:
object
Main service class for handling the pre-class lecture processing pipeline.
This class manages a multi-stage workflow for processing lecture materials, including converting presentations to different formats and generating various educational materials.
- class STAGE[source]
Bases:
object
Enumeration of processing stages for the pre-class pipeline.
- FINISHED = 100
- GEN_ASKQUESTION = 8
- GEN_DESCRIPTION = 4
- GEN_READSCRIPT = 7
- GEN_SHOWFILE = 6
- GEN_STRUCTURE = 5
- PDF2PNG = 2
- PPT2TEXT = 3
- PPTX2PDF = 1
- PUSH_AGENDA = 99
- START = 0
- static launch_worker()[source]
Launches the worker process for handling pre-class processing jobs.
Establishes a connection to RabbitMQ and begins consuming messages from the queue. Each message triggers the appropriate stage of processing based on the job’s current stage. The worker can be terminated using CTRL+C.
- Raises:
KeyboardInterrupt – When the worker is manually stopped
- static trigger(parent_service, source_file)[source]
Initiates a new pre-class processing job.
- Parameters:
parent_service (str) – Identifier of the parent service initiating this job
source_file (str) – Path to the source presentation file to be processed
- Returns:
The ID of the created job
- Return type:
str
Notes
Creates a new job in MongoDB and pushes it to RabbitMQ queue for processing. Moves the source file to a buffer location for processing.
- service.preclass.main.now(tz=None)
Returns new datetime object representing current time local to tz.
- tz
Timezone object.
If no tz is specified, uses local timezone.