

def add_group(self, name, exclusive, group_filters=None, overwrite=False):
    ' Adds a filter group.\n\n        :param str name: The name of the new filter group.\n        :param bool exclusive: Determines if the new group is exclusive, i.e.\n            only one of its items can be active at the same time.\n        :param bool overwrite: If ``True``, an existing group with the same\n            name will be overwritten. If ``False`` and a group with the same\n            name exists, a value error is raised.\n            Default: False\n        '
    if (name in self.filters):
        prev = self.filters[name]
        if isinstance(prev, FilterManager.Filter):
            raise ValueError('A filter with this name already exists!')
        if (not overwrite):
            raise ValueError('A filter group with this name already exists!')
    g = self.FilterGroup(exclusive)
    if group_filters:
        if exclusive:
            for f in group_filters.itervalues():
                f.active = False
            group_filters.values()[0].active = True
        g.filters = group_filters
    else:
        g.filters = OrderedDict()
    self.filters[name] = g

dataset/ETHPy150Open rproepp/spykeviewer/spykeviewer/plugin_framework/filter_manager.py FilterManager.add_group/original