summaryrefslogtreecommitdiff
path: root/testapp/exam/language_registry.py
blob: 4d56de29b67c34593d001f05a10d9e70eec1f9f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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()