|
|
@ -86,11 +86,21 @@ class Apps(SmartTop) :
|
|
|
|
r = pd.DataFrame()
|
|
|
|
r = pd.DataFrame()
|
|
|
|
if 'filter' in args :
|
|
|
|
if 'filter' in args :
|
|
|
|
pattern = "|".join(args['filter'])
|
|
|
|
pattern = "|".join(args['filter'])
|
|
|
|
r = df[df.name.str.contains(pattern)]
|
|
|
|
i = df.cmd.str.contains(pattern)
|
|
|
|
|
|
|
|
r = df[i]
|
|
|
|
|
|
|
|
ii= (1 + np.array(i)*-1) == 1
|
|
|
|
|
|
|
|
other = pd.DataFrame(df[ii].sum()).T
|
|
|
|
|
|
|
|
other.user = other.name = other.status = other.cmd = other.args = 'other'
|
|
|
|
|
|
|
|
other.started = other.pid = -1
|
|
|
|
|
|
|
|
other = other[other.columns[1:]]
|
|
|
|
for name in args['filter'] :
|
|
|
|
for name in args['filter'] :
|
|
|
|
filter = "name == '"+name+"'"
|
|
|
|
i = r.cmd.str.contains(str(name),case=False,na=False)
|
|
|
|
if r.query(filter).size == 0 :
|
|
|
|
if i.sum() == 0:
|
|
|
|
r = r.append(self.empty(name))
|
|
|
|
r = r.append(self.empty(name),sort=False)
|
|
|
|
|
|
|
|
else :
|
|
|
|
|
|
|
|
r.loc[i,'name'] = name
|
|
|
|
|
|
|
|
r = r.append(other,sort=False)
|
|
|
|
|
|
|
|
r.index = np.arange(r.shape[0])
|
|
|
|
return r
|
|
|
|
return r
|
|
|
|
except Exception,e:
|
|
|
|
except Exception,e:
|
|
|
|
print (e)
|
|
|
|
print (e)
|
|
|
@ -133,7 +143,10 @@ class Folders(SmartTop):
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# If the folder does NOT exists it should not be treated.
|
|
|
|
# If the folder does NOT exists it should not be treated.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
r = pd.DataFrame(self._get(path))
|
|
|
|
rows = self._get(path)
|
|
|
|
r = pd.DataFrame([{"name":path,"files":r.shape[0],"age_in_days":r.age.mean(),"size_in_kb":r.size.sum()}])
|
|
|
|
if len(rows) > 0 :
|
|
|
|
_out = _out.append(r)
|
|
|
|
print rows
|
|
|
|
|
|
|
|
r = pd.DataFrame(rows)
|
|
|
|
|
|
|
|
r = pd.DataFrame([{"name":path,"files":r.shape[0],"age_in_days":r.age.mean(),"size_in_kb":r.size.sum()}])
|
|
|
|
|
|
|
|
_out = _out.append(r)
|
|
|
|
return _out
|
|
|
|
return _out
|
|
|
|