4 def add(self, register):
5 for i, r in enumerate(self):
6 if r.weight > register.weight:
7 self.insert(i, register)
12 """Links next in the very top of the page"""
13 HEADER_LINKS = 'HEADER_LINKS'
15 """The tabs next to the top of the page"""
16 PAGE_TOP_TABS = 'PAGE_TOP_TABS'
20 HEADER_LINKS: Registry(),
21 PAGE_TOP_TABS: Registry()
25 def register(registry, ui_object):
26 if not registry in __CONTAINER:
27 raise('unknown registry')
29 __CONTAINER[registry].add(ui_object)
31 def register_multi(registry, *ui_objects):
32 for ui_object in ui_objects:
33 register(registry, 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 *