예제 #1
0
파일: window.py 프로젝트: sonictk/cmt
 def populate_components(self):
     """Populates the component tree with the available components"""
     root_node = ComponentNode(None)
     components = core.get_components()
     comp_lookup = {}
     for comp in components:
         tokens = comp.split('.')
         parent = root_node
         path_tokens = []
         for token in tokens:
             path_tokens.append(token)
             path = '.'.join(path_tokens)
             node_parent = comp_lookup.get(path)
             if not node_parent:
                 parent = ComponentNode(path, parent)
                 comp_lookup[path] = parent
             else:
                 parent = node_parent
     model = ComponentModel(root_node)
     self.component_tree.setModel(model)
     self.expand_tree(root_node, model)
예제 #2
0
 def test_get_components(self):
     components = core.get_components()
     self.assertIn('cmt.cqueue.components.file', components)
예제 #3
0
 def test_get_components(self):
     components = core.get_components()
     self.assertIn('cmt.cqueue.components.file', components)