Commit 950a98e3 by Kálmán Viktor

add detailed file statistics

parent 7de1a3f5
......@@ -88,6 +88,25 @@ def get_storage_stat(path):
'free_percent': free_space_percent}
def get_file_statistics(datastore):
disks = [Disk.get(datastore, name).get_desc()
for name in listdir(datastore)
if not name.endswith((".dump", "trash"))]
dumps = [{'name': name,
'size': path.getsize(path.join(datastore, name))}
for name in listdir(datastore) if name.endswith(".dump")]
trash = [{'name': name,
'size': path.getsize(path.join(datastore, trash_directory,
for name in listdir(path.join(datastore, trash_directory))]
return {
'dumps': dumps,
'trash': trash,
'disks': disks,
def move_to_trash(datastore, disk_name):
''' Move path to the trash directory.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment