""" Retrieve data from command line """
import subprocess
import json


def get_mount_point():
    """ Retrieve Mount points """
    jsondata = {}
    output = subprocess.check_output(['df', '-h'])
    output = output.decode('utf-8')
    f_file = output.split('\n')
    with open('out.json', 'w') as outfile:
        for item in f_file:
            linha = item.split()
            if linha[2:10] <> 'Filesystem':
                jsondata = json.dumps(linha, separators=(',', ': '), indent=4)
                outfile.write(jsondata)

if __name__ == ("__main__"):
    get_mount_point()

@@ -6,17 +6,17 @@
 etrieve 
-d
+D
 ata from
@@ -16,17 +16,17 @@
 ta from 
-c
+C
 ommand l
@@ -37,38 +37,153 @@
 %22%22%22%0A
-import subprocess%0Aimport json%0A
+%0Afrom collections import namedtuple%0Aimport subprocess%0Aimport json%0A%0AFData = namedtuple(%22FData%22, %22filesystem size used avail perc_used mounted_on%22)
 %0A%0Ade
@@ -241,26 +241,8 @@
 %22%22%22%0A
-    jsondata = %7B%7D%0A
     
@@ -356,16 +356,36 @@
 t('%5Cn')%0A
+    usage_list = %5B%5D%0A
     with
@@ -441,24 +441,30 @@
 em in f_file
+%5B1:-1%5D
 :%0A          
@@ -468,18 +468,17 @@
      lin
-ha
+e
  = item.
@@ -501,132 +501,88 @@
     
-if linha%5B2:10%5D %3C%3E 'Filesystem':%0A                jsondata = json.dumps(linha, separators=(',', ': '), indent=4)%0A     
+usage_list.append(FData(*line)._asdict())%0A            print(usage_list)%0A
         
    o
@@ -577,19 +577,16 @@
         
-   
 outfile.
@@ -599,12 +599,26 @@
 json
-data
+.dumps(usage_list)
 )%0A%0Ai

Update disk2.py