4 def add(self, register):
5 for i, r in enumerate(self):
6 if r.weight > register.weight:
7 self.insert(i, register)
13 HEAD_CONTENT = 'HEAD_CONTENT'
14 HEADER_LINKS = 'HEADER_LINKS'
15 PAGE_TOP_TABS = 'PAGE_TOP_TABS'
16 FOOTER_LINKS = 'FOOTER_LINKS'
17 PROFILE_TABS = 'PROFILE_TABS'
21 HEAD_CONTENT: Registry(),
22 HEADER_LINKS: Registry(),
23 PAGE_TOP_TABS: Registry(),
24 FOOTER_LINKS: Registry(),
25 PROFILE_TABS: Registry(),
29 def register(registry, *ui_objects):
30 if not registry in __CONTAINER:
31 raise('unknown registry')
33 for ui_object in ui_objects:
34 __CONTAINER[registry].add(ui_object)
36 def get_registry_by_name(name):
39 if not name in __CONTAINER:
40 raise('unknown registry')
42 return __CONTAINER[name]
46 from ui_objects import *