service.preclass.model module

class service.preclass.model.AgendaStruct(title, children=None, function=None)[source]

Bases: object

A tree structure representing an agenda or outline with hierarchical nodes.

title

The title/heading of this agenda item

Type:

str

children

List of child AgendaStruct or PPTPageStruct objects

Type:

list

dfs_recursive_call(function)[source]

Recursively call the given function on each node in the agenda structure.

Parameters:

function – The function to be called on each node

flatten()[source]

Return a flattened list of all nodes in the agenda structure.

Returns:

List of all nodes in the agenda structure

Return type:

list

formalize()[source]

Return a string representation of the title/heading of this agenda item

classmethod from_dict(dict)[source]

Create an agenda structure from a dictionary representation.

Parameters:

dict – Dictionary representation of the agenda structure

Returns:

The agenda structure object

Return type:

AgendaStruct

get_structure_trace()[source]

Generate a formatted string representation of the structure’s hierarchy.

Returns:

Indented string showing the structure trace

Return type:

str

insert_page(page, trace)[source]

Insert a page into the agenda structure following the given trace path.

Parameters:
  • page – The page object to insert

  • trace (list) – List of section titles forming path to insertion point

Returns:

True if page was inserted successfully, False otherwise

Return type:

bool

serialize()[source]
to_dict()[source]

Return a dictionary representation of the agenda structure.

Returns:

Dictionary representation of the agenda structure

Return type:

dict

type = 'node'
class service.preclass.model.AskQuestion(question, question_type, selects, answer, reference)[source]

Bases: FunctionBase

Function to present a question to users.

Parameters:
  • question (str) – The question text

  • question_type – Type/category of question

  • selects – Available answer options

  • answer – Correct answer

  • reference – Reference material (commented out)

class service.preclass.model.FunctionBase(call, label, value)[source]

Bases: object

Base class for defining interactive functions/actions within the agenda.

call

Function identifier/name

Type:

str

label

Display label for the function

Type:

str

value

Parameters/values for the function

Type:

dict

classmethod from_dict(dict)[source]
to_dict()[source]
class service.preclass.model.PPTPageStruct(page, stringified, function=None)[source]

Bases: object

Represents a PowerPoint page/slide in the agenda structure.

content

The actual page/slide content

stringified

String representation of the page

Type:

str

dfs_recursive_call(function)[source]
flatten(condition=None)[source]
formalize()[source]
classmethod from_dict(dict)[source]
get_structure_trace()[source]
serialize()[source]
to_dict()[source]
type = 'ppt'
class service.preclass.model.ReadScript(script)[source]

Bases: FunctionBase

Function to read a script/text.

Parameters:

script (str) – The script content to be read

class service.preclass.model.ShowFile(file_id)[source]

Bases: FunctionBase

Function to display a file.

Parameters:

file_id – Identifier for the file to be shown