예제 #1
0
    def step(self):
        """ Using the workingdir attribute has to find the HD and then get the
        available free space."""

        usage = disk_usage(self.workingDir)

        self.storeUsageData(usage)

        # Stats line readable:
        free = prettySize(usage.free)
        total = prettySize(usage.total)
        used = prettySize(usage.used)

        # Free space in GB
        freeGB = usage.free / (1024.0**3.0)

        # Notify only if free space is bellow the threshold in GB
        if freeGB < self.minimumFreeSpace:
            self.notify(
                "WARNING: There is only %s left for %s" %
                (free, self.workingDir),
                "Free: %s, Total: %s, Used: %s, Threshold: %s" %
                (free, total, used, self.minimumFreeSpace))
예제 #2
0
파일: browser.py 프로젝트: liz18/scipion
 def getSizeStr(self):
     """ Return a human readable string of the file size."""
     return prettySize(self.getSize()) if self._stat else '0'
예제 #3
0
 def getSize(self):
     """ Return a human readable string of the file size."""
     return prettySize(self._stat.st_size) if self._stat else 0
예제 #4
0
 def getSize(self):
     """ Return a human readable string of the file size."""
     return prettySize(self._stat.st_size) if self._stat else 0
예제 #5
0
 def __repr__(self):
     return "%s: %d (%s)" % (self.ext, len(self),
                             pwutils.prettySize(self.size()))
예제 #6
0
파일: browser.py 프로젝트: I2PC/scipion
 def getSizeStr(self):
     """ Return a human readable string of the file size."""
     return prettySize(self.getSize()) if self._stat else '0'