|
|
|
@ -287,7 +287,29 @@ class FileWatch(Analysis):
|
|
|
|
|
xo = np.array(ML.Extract(['size','age'],xo_raw))
|
|
|
|
|
name = re.findall("([a-z,A-Z,0-9]+$)",folder)
|
|
|
|
|
name = name[0]
|
|
|
|
|
xo = {"label":folder,"details":xo_raw,"summary":{"size":round(np.sum(xo[:,0]),2),"age":round(np.mean(xo[:,1]),2),"count":len(xo[:,1])}}
|
|
|
|
|
size = round(np.sum(xo[:,0]),2)
|
|
|
|
|
if size > 1000 :
|
|
|
|
|
size = round(size/1000,2)
|
|
|
|
|
units = ' GB'
|
|
|
|
|
elif size > 1000000:
|
|
|
|
|
size = round(size/1000000,2)
|
|
|
|
|
units = ' TB'
|
|
|
|
|
else:
|
|
|
|
|
size = size
|
|
|
|
|
units = ' MB'
|
|
|
|
|
size = str(size)+ units
|
|
|
|
|
age = round(np.mean(xo[:,1]),2)
|
|
|
|
|
if age > 30 and age <= 365 :
|
|
|
|
|
age = round(age/30,2)
|
|
|
|
|
units = ' Months'
|
|
|
|
|
elif age > 365 :
|
|
|
|
|
age = round(age/365,2)
|
|
|
|
|
units = ' Years'
|
|
|
|
|
else:
|
|
|
|
|
age = age
|
|
|
|
|
units = ' Days'
|
|
|
|
|
age = str(age)+units
|
|
|
|
|
xo = {"label":folder,"details":xo_raw,"summary":{"size":size,"age":age,"count":len(xo[:,1])}}
|
|
|
|
|
xo["name"] = name
|
|
|
|
|
xo['day'] = now.day
|
|
|
|
|
xo['month'] = now.month
|
|
|
|
|