minor bug fixes

master
Steve L. Nyemba 8 years ago
parent 5f3779b976
commit 2e4c8cf9f3

@ -144,7 +144,7 @@ def trends ():
@app.route('/download',methods=['POST']) @app.route('/download',methods=['POST'])
def requirements(): def requirements():
stream = request.form['missing'] stream = request.form['missing']
print stream
stream = "\n".join(json.loads(stream)) stream = "\n".join(json.loads(stream))
headers = {"content-disposition":"attachment; filename=requirements.txt"} headers = {"content-disposition":"attachment; filename=requirements.txt"}
return Response(stream,mimetype='text/plain',headers=headers) return Response(stream,mimetype='text/plain',headers=headers)

@ -285,7 +285,12 @@ class FileWatch(Analysis):
if os.path.exists(folder): if os.path.exists(folder):
xo_raw = self.evaluate(folder) xo_raw = self.evaluate(folder)
xo = np.array(ML.Extract(['size','age'],xo_raw)) xo = np.array(ML.Extract(['size','age'],xo_raw))
if len(xo) == 0:
continue
name = re.findall("([a-z,A-Z,0-9]+$)",folder) name = re.findall("([a-z,A-Z,0-9]+$)",folder)
if len(name) == 0:
name = [folder]
name = name[0] name = name[0]
size = round(np.sum(xo[:,0]),2) size = round(np.sum(xo[:,0]),2)
if size > 1000 : if size > 1000 :

@ -220,7 +220,8 @@ class ThreadManager:
lock = RLock() lock = RLock()
ThreadManager.Pool['monitor'] = Top(config,lock) ThreadManager.Pool['monitor'] = Top(config,lock)
ThreadManager.Pool['learner'] = Learner(config,lock) ThreadManager.Pool['learner'] = Learner(config,lock)
ThreadManager.Pool['file-watch'] = FileWatchWorker(config,lock) if 'folders' in config :
ThreadManager.Pool['file-watch'] = FileWatchWorker(config,lock)
for id in ThreadManager.Pool : for id in ThreadManager.Pool :
thread = ThreadManager.Pool[id] thread = ThreadManager.Pool[id]
thread.start() thread.start()

Loading…
Cancel
Save