module timelinelib.features.experimental.experimentalfeatures¶
- ExperimentalFeatures is responsible for reading and storing experimental features
configuration, to and from the configuration file. It also holds a list of available experimental features. All experimental features are instantiated when this file is loaded.
- To add a new experimental feature, do as follows:
Create a new file in timelinelib.features.experimental, defining a class that inherits from ExperimentalFeature and calls the parent __init__()- function with the two arguments DISPLAY_NAME and DESCRIPTION.
- Instantiate the new experimental feature class in this file like…
NAME = NewExperimentalFeatureClass()
Add the instantiated object to the FEATURES list in this file.
- Implement the feature logic under the condition…
if NAME.enabled():
If new methods are created that only are used by the new feature, decorate these functions with @experimental_feature(NAME)
-
timelinelib.features.experimental.experimentalfeatures.
EXTENDED_CONTAINER_HEIGHT
= <timelinelib.features.experimental.experimentalfeaturecontainersize.ExperimentalFeatureContainerSize object>¶
-
timelinelib.features.experimental.experimentalfeatures.
NEGATIVE_JULIAN_DAYS
= <timelinelib.features.experimental.experimentalfeaturenegativejuliandays.ExperimentalFeatureNegativeJulianDays object>¶
-
timelinelib.features.experimental.experimentalfeatures.
EXTENDED_CONTAINER_STRATEGY
= <timelinelib.features.experimental.experimentalfeatureextendedcontainerstrategy.ExperimentalFeatureExtendedContainerStrategy object>¶
-
timelinelib.features.experimental.experimentalfeatures.
FEATURES
= (<timelinelib.features.experimental.experimentalfeaturecontainersize.ExperimentalFeatureContainerSize object>, <timelinelib.features.experimental.experimentalfeaturenegativejuliandays.ExperimentalFeatureNegativeJulianDays object>, <timelinelib.features.experimental.experimentalfeatureextendedcontainerstrategy.ExperimentalFeatureExtendedContainerStrategy object>)¶
-
exception
timelinelib.features.experimental.experimentalfeatures.
ExperimentalFeatureException
[source]¶ Bases:
Exception
-
class
timelinelib.features.experimental.experimentalfeatures.
ExperimentalFeatures
[source]¶ Bases:
object
-
timelinelib.features.experimental.experimentalfeatures.
experimental_feature
(feature)[source]¶ The syntax for decorators with arguments is a bit different - the decorator with arguments should return a function that will take a function and return another function. So it should really return a normal decorator.
Decorator used for methods, only used by an Experimental feature. The purpose of the decorator is to simplify removal of the feature code if it is decided not to implement the feature. Example:
@experimental_feature(EVENT_DONE) def foo()
pass