service.preclass.processors.gen_showfile module
- class service.preclass.processors.gen_showfile.SERVICE[source]
Bases:
object
Service class for handling show file generation tasks through a message queue system. Provides functionality for triggering jobs and processing them asynchronously.
- static callback(ch, method, properties, body)[source]
Callback function for processing show file generation jobs from the message queue.
- Parameters:
ch – Channel object from RabbitMQ
method – Method frame from RabbitMQ
properties – Properties frame from RabbitMQ
body – Message body containing the job ID
- static launch_worker()[source]
Launches a worker process to consume and process jobs from the message queue. Can be terminated with CTRL+C.
- static trigger(parent_service, lecture_id, parent_job_id)[source]
Triggers a new show file generation job.
- Parameters:
parent_service (str) – Name of the parent service
lecture_id (ObjectId) – ID of the lecture to process
parent_job_id (ObjectId) – ID of the parent job
- Returns:
The ID of the created job
- Return type:
str
- class service.preclass.processors.gen_showfile.SourceFileBinder(agenda)[source]
Bases:
object
Binds source files to agenda nodes by extracting and associating ShowFile objects.
- Parameters:
agenda (AgendaStruct) – The agenda structure to process
- service.preclass.processors.gen_showfile.now(tz=None)
Returns new datetime object representing current time local to tz.
- tz
Timezone object.
If no tz is specified, uses local timezone.