A simple ComponentRegistry to store components.

This commit is contained in:
Emil Stenström 2015-06-11 20:42:16 +02:00
parent 22b00a4a62
commit 313852ce21
4 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,9 @@
class ComponentRegistry(object):
def __init__(self):
self._registry = {} # component name -> component_class mapping
def register(self, name=None, component=None):
self._registry[name] = component
# This variable represents the global component registry
registry = ComponentRegistry()