def get_block_item_attributes(self, block_index):
     """ Overloads the BaseAdapters stock implementation of this method """
     block = self._topology.blocks[block_index]
     attrs = BlockItemAttributes()
     attrs.bgcolor = None
     attrs.border_color = "black"
     attrs.border_width = 5
     #attrs.label = block.vertex.name
     attrs.tooltip_text = "Node:\t%s\nCPU:\t%d\nMEM:\t%s\nThreads:\t%d" % (
         block.vertex.name, block.vertex.cpu_load_mean,
         sizeof_fmt(block.vertex.virt_mem_mean), block.vertex.num_threads)
     attrs.label_color = "black"
     #         attrs.spacerwidth = block.vertex.
     #attrs.spacerwidth = 30
     #attrs.label = block.vertex.name
     #attrs.label = "%s\nCPU: %d\nMEM: %s" % (block.vertex.name, block.vertex.cpu_load_mean, sizeof_fmt(block.vertex.virt_mem_mean))
     toplen = len("%s" % (block.vertex.name))
     cpulen = len("CPU: %d" % (block.vertex.cpu_load_mean))
     memlen = len("MEM: %s" % (sizeof_fmt(block.vertex.virt_mem_mean)))
     thrlen = len("Thr: %d" % (block.vertex.num_threads))
     maxlen = toplen if toplen > cpulen else cpulen
     maxlen = maxlen if maxlen > memlen else memlen
     maxlen = maxlen if maxlen > thrlen else thrlen
     toplen = maxlen - toplen
     cpulen = maxlen - cpulen
     memlen = maxlen - memlen
     thrlen = maxlen - thrlen
     topstr = "%s" % (block.vertex.name)
     topstr = topstr.ljust(toplen)
     cpustr = "CPU: %d" % (block.vertex.cpu_load_mean)
     cpustr = cpustr.ljust(cpulen)
     memstr = "MEM: %s" % (sizeof_fmt(block.vertex.virt_mem_mean))
     memstr = memstr.ljust(memlen)
     thrstr = "Thr: %d" % (block.vertex.num_threads)
     thrstr = thrstr.ljust(thrlen)
     attrs.label = "%s\n%s\n%s\n%s" % (topstr, cpustr, memstr, thrstr)
     #attrs.width = 15
     if block.vertex.virt_mem_mean > 1073741824:
         attrs.spacerwidth = 180
         attrs.width = 180
     elif block.vertex.virt_mem_mean > 1048576 * 100:
         attrs.spacerwidth = 160
         attrs.width = 160
     elif block.vertex.virt_mem_mean > 1048576 * 10:
         attrs.spacerwidth = 140
         attrs.width = 140
     elif block.vertex.virt_mem_mean > 1048576:
         attrs.spacerwidth = 120
         attrs.width = 120
     elif block.vertex.virt_mem_mean > 1024 * 100:
         attrs.spacerwidth = 100
         attrs.width = 100
     elif block.vertex.virt_mem_mean > 1024 * 10:
         attrs.spacerwidth = 80
         attrs.width = 80
     else:
         attrs.spacerwidth = 50
         attrs.width = 50
     return attrs
    def get_block_item_attributes(self, block_index):
        """ Overloads the BaseAdapters stock implementation of this method """
        block = self._topology.blocks[block_index]
        attrs = BlockItemAttributes()
        attrs.bgcolor = None
        attrs.border_color = "black"
        attrs.border_width = 5
        attrs.label = block.vertex.name
        attrs.tooltip_text = "Node:\t%s\nCPU:\t%d\nMEM:\t%s\nThreads:\t%d" % (block.vertex.name, block.vertex.cpu_load_mean, sizeof_fmt(block.vertex.virt_mem_mean), block.vertex.num_threads)
        attrs.label_color = "black"
#         attrs.spacerwidth = block.vertex.
        attrs.spacerwidth = 30
        return attrs
 def get_block_item_attributes(self, block_index):
     """ Overloads the BaseAdapters stock implementation of this method """
     block = self._topology.blocks[block_index]
     attrs = BlockItemAttributes()
     attrs.bgcolor = None
     attrs.border_color = "black"
     attrs.border_width = 5
     attrs.label = block.vertex.name
     attrs.tooltip_text = "Node:\t%s\nCPU:\t%d\nMEM:\t%s\nThreads:\t%d" % (
         block.vertex.name, block.vertex.cpu_load_mean,
         sizeof_fmt(block.vertex.virt_mem_mean), block.vertex.num_threads)
     attrs.label_color = "black"
     #         attrs.spacerwidth = block.vertex.
     attrs.spacerwidth = 30
     return attrs