Package npsgd :: Module model_manager
[hide private]
[frames] | no frames]

Module model_manager

source code

Model (plug-in) loader with versioning support.

Classes [hide private]
  InvalidModelError
  ModelManager
Object for keeping track of all models available to the NPSGD daemons.
  ModelScannerThread
Thread for periodically loading new versions of models.
Functions [hide private]
 
loadMembers(mod, version)
Steps through all classes in a given module and loads those that are NPSGD models.
source code
 
setupModels()
Attempts to do the initial load of all models.
source code
 
startScannerThread()
Start the dynamic model loader, loading models as they are modified.
source code
Variables [hide private]
  modelScannerThread = None
  modelManager = ModelManager()
  __package__ = 'npsgd'
Function Details [hide private]

setupModels()

source code 

Attempts to do the initial load of all models. Must be called on script startup.

This method scans the the model directory and finds all python scripts available. It computes a hash of the scripts (i.e. a 'version') then attempts to load all NPSGD models held within, using the version previously configured.