blob: 207cd21c71003548ba6d5dc6f51d160cad8fb4fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()
|