def test_run_file(self): self._create_test_daemon(1) dir_name = 'test_daemon_1' self.assertLess(23, len(run_file(dir_name))) run_file(dir_name, content='some new content') self.assertEqual('some new content', run_file(dir_name))
def _details(daemon_id): return render_template('_details.html', daemon_id=daemon_id, run_file_content=core.run_file(daemon_id), run_user_file_content=core.run_file(daemon_id, run_user=True), run_log_file=core.log_file_locations(daemon_id, 'run_log')[0], daemon_log_file=core.log_file_locations(daemon_id, 'daemon_log')[0], autostart=core.daemon_autostart(daemon_id))
def _details(daemon_id): return render_template( '_details.html', daemon_id=daemon_id, run_file_content=core.run_file(daemon_id), run_user_file_content=core.run_file(daemon_id, run_user=True), run_log_file=core.log_file_locations(daemon_id, 'run_log')[0], daemon_log_file=core.log_file_locations(daemon_id, 'daemon_log')[0], autostart=core.daemon_autostart(daemon_id))
def daemon_action_save_file(daemon_id): filename = request.form['filename'] content = request.form['content'] if filename == 'run': core.run_file(daemon_id, content) elif filename == 'run-user': core.run_file(daemon_id, content, run_user=True) else: abort(405) return Response(status=204)