bug fix ...

data-collector
Steve L. Nyemba 6 years ago
parent 3e65591edf
commit 8af1094563

@ -109,7 +109,7 @@ class Collector :
except Exception,e: except Exception,e:
Logger.log(action='error',value=e.message) Logger.log(action='error',value=e.message)
print e print e
break #break

@ -137,6 +137,7 @@ class Folders(SmartTop):
paths = [args['path']] paths = [args['path']]
else: else:
paths = args['path'] paths = args['path']
paths = paths
_out = pd.DataFrame() _out = pd.DataFrame()
for path in paths : for path in paths :
if os.path.exists(path) : if os.path.exists(path) :
@ -145,8 +146,10 @@ class Folders(SmartTop):
# #
rows = self._get(path) rows = self._get(path)
if len(rows) > 0 : if len(rows) > 0 :
print rows
r = pd.DataFrame(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()}]) 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) _out = _out.append(r,sort=False)
#
# @TODO: The state of the hard-drive would be a good plus
return _out return _out

Loading…
Cancel
Save