Package Gnumed :: Package timelinelib :: Package features :: Package experimental :: Module experimentalfeatures
[frames] | no frames]

Module experimentalfeatures

source code


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)

Classes
  ExperimentalFeatureException
  ExperimentalFeatures
Functions
 
experimental_feature(feature)
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.
source code
Variables
  EXTENDED_CONTAINER_HEIGHT = ExperimentalFeatureContainerSize()
  NEGATIVE_JULIAN_DAYS = ExperimentalFeatureNegativeJulianDays()
  EXTENDED_CONTAINER_STRATEGY = ExperimentalFeatureExtendedConta...
  FEATURES = EXTENDED_CONTAINER_HEIGHT, NEGATIVE_JULIAN_DAYS, EX...

Imports: ExperimentalFeatureContainerSize, ExperimentalFeatureNegativeJulianDays, ExperimentalFeatureExtendedContainerStrategy


Function Details

experimental_feature(feature)

source code 

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


Variables Details

EXTENDED_CONTAINER_STRATEGY

Value:
ExperimentalFeatureExtendedContainerStrategy()

FEATURES

Value:
EXTENDED_CONTAINER_HEIGHT, NEGATIVE_JULIAN_DAYS, EXTENDED_CONTAINER_ST\
RATEGY