Ejemplo n.º 1
0
 def build_update_request(self, block_version, block_cell_name):
     request = FinderRequest()
     existing = ReferencedDependencies()
     existing[block_version][CPPDeclaration(block_cell_name)].add(block_cell_name)
     request.existing = existing
     request.policy = Policy.default()
     request.find = False
     request.update = True
     return request
Ejemplo n.º 2
0
 def build_update_request(self, block_version, block_cell_name):
     request = FinderRequest()
     existing = ReferencedDependencies()
     existing[block_version][CPPDeclaration(block_cell_name)].add(
         block_cell_name)
     request.existing = existing
     request.policy = Policy.default()
     request.find = False
     request.update = True
     return request
    def test_fiunder_request_existing(self):
        f = FinderRequest()
        self.assertFalse(f)
        existing = ReferencedDependencies()
        version = BlockVersion('user/user/block/master', 1)
        existing[version][CPPDeclaration("file.h")].add(CellName("file.h"))
        f.existing = existing
        f.update = True
        f.policy = Policy.default()
        #print f
        s = f.serialize()
        #print s
        f2 = FinderRequest.deserialize(s)

        self.assertEquals(f, f2)
        self.assertTrue(f2)
Ejemplo n.º 4
0
    def test_fiunder_request_existing(self):
        f = FinderRequest()
        self.assertFalse(f)
        existing = ReferencedDependencies()
        version = BlockVersion('user/user/block/master', 1)
        existing[version][CPPDeclaration("file.h")].add(CellName("file.h"))
        f.existing = existing
        f.update = True
        f.policy = Policy.default()
        #print f
        s = f.serialize()
        #print s
        f2 = FinderRequest.deserialize(s)

        self.assertEquals(f, f2)
        self.assertTrue(f2)
Ejemplo n.º 5
0
 def find_request(self, policy):
     request = FinderRequest(policy)
     request.existing = self.external_dependencies()
     blocks = self.blocks
     # ONly those that have a block to be searched for
     unresolved = set()
     local_unresolved = set()
     for block_holder in self.block_holders:
         includes = block_holder.includes
         paths_size = len(block_holder.paths)
         for declaration in self.external_unresolved():
             try:
                 new_declaration, _ = declaration.prefix(includes, paths_size)
             except:
                 new_declaration = declaration
             decl_block = new_declaration.block()
             if decl_block and decl_block not in blocks:
                 unresolved.add(new_declaration)
             else:
                 local_unresolved.add(new_declaration)
     request.unresolved = unresolved
     request.block_names = self.blocks
     return request, local_unresolved
Ejemplo n.º 6
0
 def find_request(self, policy):
     request = FinderRequest(policy)
     request.existing = self.external_dependencies()
     blocks = self.blocks
     # ONly those that have a block to be searched for
     unresolved = set()
     local_unresolved = set()
     for block_holder in self.block_holders:
         includes = block_holder.includes
         paths_size = len(block_holder.paths)
         for declaration in self.external_unresolved():
             try:
                 new_declaration, _ = declaration.prefix(
                     includes, paths_size)
             except:
                 new_declaration = declaration
             decl_block = new_declaration.block()
             if decl_block and decl_block not in blocks:
                 unresolved.add(new_declaration)
             else:
                 local_unresolved.add(new_declaration)
     request.unresolved = unresolved
     request.block_names = self.blocks
     return request, local_unresolved