logging cleaned up
unified errorExit function instead of explicite sys.exit calls add config_file argument to CryptoBoxProps add getCapacity method to CryptoBoxContainer removed "classes.txt"
This commit is contained in:
parent
bb16749b81
commit
707fb71476
5 changed files with 168 additions and 85 deletions
|
@ -83,6 +83,19 @@ class CryptoBoxContainer:
|
|||
|
||||
def isMounted(self):
|
||||
return os.path.ismount(self.__getMountPoint())
|
||||
|
||||
|
||||
def getCapacity(self):
|
||||
"""return the current capacity state of the volume
|
||||
|
||||
the result is a tuple of values in megabyte:
|
||||
(size, available, used)
|
||||
"""
|
||||
info = os.statvfs(self.__getMountPoint())
|
||||
return (
|
||||
int(info.f_bsize*info.f_blocks/1024/1024),
|
||||
int(info.f_bsize*info.f_bavail/1024/1024),
|
||||
int(info.f_bsize*(info.f_blocks-info.f_bavail)/1024/1024))
|
||||
|
||||
|
||||
def create(self, type, password=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue