def list(team_id, channel, params): text = "Here are the current examples files:" attachments = [] files = '' for file in Files.find('./web_root/**/*.html'): files += '{0} \n'.format(file.replace('./web_root/', '')) attachments.append({'text': files}) return text, attachments
def cleanup_chrome_processes_and_tmp_files(): # remote temp files for file in Files.find('/tmp/core.headless_shell.*'): pid = file.split('.')[-1] Process.run('pkill',['-TERM','-P',str(pid)]) # this doesn't seem to be working since the "headless_shell <defunct>" is still there Files.delete(file)