diff options
Diffstat (limited to 'testapp/exam/language_registry.py')
-rw-r--r-- | testapp/exam/language_registry.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testapp/exam/language_registry.py b/testapp/exam/language_registry.py new file mode 100644 index 0000000..207cd21 --- /dev/null +++ b/testapp/exam/language_registry.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +class LanguageRegistry(object): + def __init__(self): + self._registry = {} + + ## Public Protocol ########## + def get_class(self, language): + return self._registry[language] + + ## Public Protocol ########## + def register(self, language, cls): + self._registry[language] = cls + + +registry = LanguageRegistry()
\ No newline at end of file |