Source code for Channels

# CellTracking.py
# By MW, Jun 2013
# GPLv3+
#
# Class managing the Channels

import imp, logging

Channel = imp.load_source("Channel", './bin/Movies/Channels/Channel.py')  # Loading the Movie class
channels_dict = {}

[docs]def new_channel(name) : """Function that initialize a new channel. Takes a channel name as an input""" # Check if name is not already used if not (name in channels_dict.keys()) : c = Channel.Channel(name) # Initialize an empty channels_dict[name] = c return c else : logging.error("Channel name already used")
[docs]def get_channel(name) : """Gets a channel given its name""" try : return channels_dict[name] except : logging.error("The channel '%s' does not exist in this movie", name)
[docs]def get_channels_dict() : """Returns the list of channels""" return channels_dict