Feature

Todo

Docstrings (module, utilities)

Utilities

indico.modules.events.features.util.format_feature_names(names)
indico.modules.events.features.util.get_disallowed_features(event)

Get a set containing the names of features which are not available for an event.

indico.modules.events.features.util.get_enabled_features(event, only_explicit=False)

Returns a set of enabled feature names for an event

indico.modules.events.features.util.get_feature_definition(name)

Gets a feature definition

indico.modules.events.features.util.get_feature_definitions()

Gets a dict containing all feature definitions

indico.modules.events.features.util.is_feature_enabled(event, name)

Checks if a feature is enabled for an event.

Parameters:
  • event – The event (or event ID) to check.
  • name – The name of the feature.
indico.modules.events.features.util.require_feature(event, name)

Raises a NotFound error if a feature is not enabled

Parameters:
  • event – The event (or event ID) to check.
  • name – The name of the feature.
indico.modules.events.features.util.set_feature_enabled(event, name, state)

Enables/disables a feature for an event

Parameters:
  • event – The event.
  • name – The name of the feature.
  • state – If the feature is enabled or not.
Returns:

Boolean indicating if the state of the feature changed.