# Path: karmabot/core/register.py
# class FacetRegistry(dict):
#     def register(self, facet_class):
#     def __iter__(self):
#     def attach(self, subject, exclude=set()):


from .register import facet_registry
# Copyright the Karmabot authors and contributors.
# All rights reserved.  See AUTHORS.
#
# This file is part of 'karmabot' and is distributed under the BSD license.
# See LICENSE for more details.



class Subject(object):
    def __init__(self, key, name):
        self.key = key
        self.name = name
        self.data = {"name": name,
                     "+facets": [],
                     "-facets": []}
        self.facets = {}
        facet_registry.attach(self, set(self.data["-facets"]))

    def add_facet(self, facet):
        if str(facet) in self.facets:
            return
        if isinstance(facet, str):

# Path: karmabot/core/register.py
# class FacetRegistry(dict):
#     def register(self, facet_class):
#     def __iter__(self):
#     def attach(self, subject, exclude=set()):


# Path: karmabot/core/subject.py
from .register import facet_registry

# Copyright the Karmabot authors and contributors.
# All rights reserved.  See AUTHORS.
#
# This file is part of 'karmabot' and is distributed under the BSD license.
# See LICENSE for more details.



class Subject(object):
    def __init__(self, key, name):
        self.key = key
        self.name = name
        self.data = {"name": name,
                     "+facets": [],
                     "-facets": []}
        self.facets = {}
        facet_registry.attach(self, set(self.data["-facets"]))

    def add_facet(self, facet):
        if str(facet) in self.facets:
            return
        if isinstance(facet, str):

            facet = facet_registry[facet](self)