Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Return a human readable size of a blockdevice.
        

        def get_blockdevice_size_humanly(device):
	"""Return a human readable size of a blockdevice.
	"""
	size = get_blockdevice_size(device)
	if size > 5120:
		return "%dGB" % int(size/1024)
	else:
		return "%dMB" % size
        


src/c/r/cryptobox-server-0.3.0/plugins/partition/partition.py   cryptobox-server(Download)
			self.hdf[self.hdf_prefix + "BlockDevices.%d.name" % counter] = dev
			self.hdf[self.hdf_prefix + "BlockDevices.%d.size" % counter] = \
					cbox_tools.get_blockdevice_size_humanly(dev)
			self.cbox.log.debug("found a suitable block device: %s" % dev)
			counter += 1

src/c/r/cryptobox-server-0.3.0/src/cryptobox/web/dataset.py   cryptobox-server(Download)
				self["Data.CurrentDisk.busy"] = is_busy
				self["Data.CurrentDisk.size"] = cbxTools.get_blockdevice_size_humanly(
						container.get_device())
				if is_mounted:
					self.cbox.log.debug("Retrieving container's data: %s" % \
			self["Data.Disks.%d.active" % avail_counter] = is_mounted
			self["Data.Disks.%d.size" % avail_counter] = \
					cbxTools.get_blockdevice_size_humanly(container.get_device())
			if is_mounted:
				active_counter += 1