inginious.common package

Common package: basic library for INGInious, needed by all its components.

Submodules

inginious.common.asyncio_utils module

inginious.common.base module

inginious.common.course_factory module

inginious.common.courses module

Contains the class Course and utility functions

class inginious.common.courses.Course(courseid, content_description, task_factory, hook_manager)[source]

Bases: object

Represents a course

get_descriptor()[source]

Get (a copy) the description of the course

get_id()[source]

Return the _id of this course

get_task(taskid)[source]

Returns a Task object

get_tasks()[source]

Get all tasks in this course

inginious.common.custom_yaml module

inginious.common.exceptions module

Some type of exceptions used by parts of INGInious

exception inginious.common.exceptions.CourseAlreadyExistsException[source]

Bases: exceptions.Exception

exception inginious.common.exceptions.CourseNotFoundException[source]

Bases: exceptions.Exception

exception inginious.common.exceptions.CourseUnreadableException[source]

Bases: exceptions.Exception

exception inginious.common.exceptions.InvalidNameException[source]

Bases: exceptions.Exception

exception inginious.common.exceptions.TaskNotFoundException[source]

Bases: exceptions.Exception

exception inginious.common.exceptions.TaskReaderNotFoundException[source]

Bases: exceptions.Exception

exception inginious.common.exceptions.TaskUnreadableException[source]

Bases: exceptions.Exception

inginious.common.hook_manager module

Hook Manager

class inginious.common.hook_manager.HookManager[source]

Bases: object

Registers an manages hooks. Hooks are callback functions called when the inginious.backend does a specific action.

add_hook(name, callback)[source]

Add a new hook that can be called with the call_hook function

call_hook(name, **kwargs)[source]

Call all hooks registered with this name. Returns a list of the returns values of the hooks (in the order the hooks were added)

inginious.common.log module

Some common functions for logging

class inginious.common.log.CustomLogMiddleware(app, logger)[source]

WSGI middleware for logging the status in webpy

log(status, environ)[source]
inginious.common.log.get_course_logger(coursename)[source]
Parameters:coursename – the course id
Returns:a logger object associated to a specific course
inginious.common.log.init_logging(log_level=10)[source]

Init logging :param log_level: An integer representing the log level or a string representing one

inginious.common.message_meta module

inginious.common.messages module

inginious.common.task_factory module

inginious.common.tasks module

inginious.common.tasks_code_boxes module

inginious.common.tasks_problems module