def _publishDependentCell(self, block_id):
     low, high = self._biigraph._get_range_block(block_id)
     count = 0
     d = self.lbcn
     bcn = d[block_id]
     brl = self._getBlockBRL(bcn)
     for row in range(low, high + 1):
         r = SimpleCell(d[block_id])
         r.root = ID((0, bcn.block_name[-1:], 0))
         deps = DependencySet()
         dep_table = BlockVersionTable()
         for block in range(block_id):
             time = self._biigraph._get_dep_elem_offset(row, block)
             if time != -1:
                 deps.add_implicit(d[block])
                 dep_table[d[block].block_name] = \
                    BlockVersion(self._getBlockBRL(d[block]), time)
         r.dependencies = deps
         pack = PublishRequest(BlockVersion(brl, count - 1))
         pack.tag = STABLE
         count += 1
         pack.cells.append(r)
         pack.contents[r.name.cell_name] = Content(
             id_=None, load=Blob('hola {0}'.format(r.name.cell_name)))
         pack.deptable = dep_table
         self.service.publish(pack)
Esempio n. 2
0
 def _publishDependentCell(self, block_id):
     low, high = self._biigraph._get_range_block(block_id)
     count = 0
     d = self.lbcn
     bcn = d[block_id]
     brl = self._getBlockBRL(bcn)
     for row in range(low, high + 1):
         r = SimpleCell(d[block_id])
         r.root = ID((0, bcn.block_name[-1:], 0))
         deps = DependencySet()
         dep_table = BlockVersionTable()
         for block in range(block_id):
             time = self._biigraph._get_dep_elem_offset(row, block)
             if time != -1:
                 deps.add_implicit(d[block])
                 dep_table[d[block].block_name] = \
                    BlockVersion(self._getBlockBRL(d[block]), time)
         r.dependencies = deps
         pack = PublishRequest(BlockVersion(brl, count - 1))
         pack.tag = STABLE
         count += 1
         pack.cells.append(r)
         pack.contents[r.name.cell_name] = Content(id_=None, load=Blob('hola {0}'.
                                                             format(r.name.cell_name)))
         pack.deptable = dep_table
         self.service.publish(pack)
    def test_dependency_set(self):
        d1 = DependencySet()
        d1.add_implicit(BlockCellName("user/block/path/file2.h"))
        d1.add_implicit(BlockCellName("user/block/path/file3.h"))
        d1.add_implicit(BlockCellName("user/block/path/file4.h"))
        names = set()
        names.add(CPPDeclaration("iostream.h"))
        d1.update_declarations(names)

        s = d1.serialize()
        d2 = DependencySet.deserialize(s)
        self.assert_bii_equal(d1, d2)
Esempio n. 4
0
    def test_dependency_set(self):
        d1 = DependencySet()
        d1.add_implicit(BlockCellName("user/block/path/file2.h"))
        d1.add_implicit(BlockCellName("user/block/path/file3.h"))
        d1.add_implicit(BlockCellName("user/block/path/file4.h"))
        names = set()
        names.add(CPPDeclaration("iostream.h"))
        d1.update_declarations(names)

        s = d1.serialize()
        d2 = DependencySet.deserialize(s)
        self.assert_bii_equal(d1, d2)