diff --git a/smart/folder/__init__.py b/smart/folder/__init__.py index 45c8f75..a6677f7 100644 --- a/smart/folder/__init__.py +++ b/smart/folder/__init__.py @@ -52,7 +52,9 @@ def read(**args): rows = util.content(rows) r = dict(r, **rows) + N = 0 if not os.path.exists(args['path']) else len( os.listdir(args['path'])) r['path'] = args['path'] + r['files']= N r['name'] = args['path'].split(os.sep)[-1:][0] r['node'] = os.uname()[1] r['date'] = datetime.datetime.now().strftime('%m-%d-%Y') diff --git a/smart/top/__init__.py b/smart/top/__init__.py index 521b566..f769cf2 100644 --- a/smart/top/__init__.py +++ b/smart/top/__init__.py @@ -96,7 +96,7 @@ def read(**args) : tmp = df[df.name == name.strip()] if not tmp.shape[0] : tmp = {"pid":None,"user":None,"mem":0,"cpu":0,"status":"-100","started":None,"name":name,"cmd":None,"args":None,"date":d,"time":t,"node":n} - r = r.append(tmp) + r = r.append(tmp,ignore_index=True) df = r #