From f955b1891143d3639209914ca8398a5069da7ffd Mon Sep 17 00:00:00 2001 From: Nathaniel Deml Date: Wed, 6 Dec 2023 09:44:27 -0500 Subject: [PATCH 1/5] file removal. See TODO --- webenabled/mcsweb.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webenabled/mcsweb.py b/webenabled/mcsweb.py index 34657e0e..a09bbf58 100644 --- a/webenabled/mcsweb.py +++ b/webenabled/mcsweb.py @@ -4,6 +4,7 @@ import psutil import typeguard +import os # Override the typechecked decorator used in machine_common_sense to do nothing @@ -217,6 +218,13 @@ def exit_unity(): ) resp.delete_cookie('uniq_id') + # delete static/mcsinterface/ folders + app.logger.info( + f"Deleting static/mcsinterface/ folders") + os.system("find ./static/mcsinterface -name 'cmd_*' | xargs rm -r") + os.system("find ./static/mcsinterface -name 'output_*' | xargs rm -r") + # os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r") + return resp From cb8670cd5586d6fd951fd9461e8c6569ca2e232b Mon Sep 17 00:00:00 2001 From: Nathaniel Deml Date: Wed, 6 Dec 2023 09:44:35 -0500 Subject: [PATCH 2/5] file removal. See TODO --- webenabled/mcsweb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webenabled/mcsweb.py b/webenabled/mcsweb.py index a09bbf58..b6daf9ec 100644 --- a/webenabled/mcsweb.py +++ b/webenabled/mcsweb.py @@ -223,7 +223,7 @@ def exit_unity(): f"Deleting static/mcsinterface/ folders") os.system("find ./static/mcsinterface -name 'cmd_*' | xargs rm -r") os.system("find ./static/mcsinterface -name 'output_*' | xargs rm -r") - # os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r") + # TODO: os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r") return resp From 2296278d6ed7971a9649d09b274c73965bc8603b Mon Sep 17 00:00:00 2001 From: Phi Le Date: Wed, 6 Dec 2023 10:59:18 -0500 Subject: [PATCH 3/5] rearranged import --- machine_common_sense/scripts/runner_script.py | 2 +- webenabled/mcsweb.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/machine_common_sense/scripts/runner_script.py b/machine_common_sense/scripts/runner_script.py index cf7e313e..a8440176 100644 --- a/machine_common_sense/scripts/runner_script.py +++ b/machine_common_sense/scripts/runner_script.py @@ -68,7 +68,7 @@ def __init__( ) if args.save_videos: subprocess.call([ - 'ffmpeg', '-y', '-r', '20', '-i', + 'ffmpeg', '-y', '-r', '20', '-i', '-q:v', '1', scene_name + '/frame_image_%d.png', '-vcodec', 'h264', '-vf', 'format=yuv420p', scene_name + '.mp4' diff --git a/webenabled/mcsweb.py b/webenabled/mcsweb.py index b6daf9ec..f01b9e29 100644 --- a/webenabled/mcsweb.py +++ b/webenabled/mcsweb.py @@ -1,10 +1,10 @@ import logging +import os import random import string import psutil import typeguard -import os # Override the typechecked decorator used in machine_common_sense to do nothing @@ -219,8 +219,7 @@ def exit_unity(): resp.delete_cookie('uniq_id') # delete static/mcsinterface/ folders - app.logger.info( - f"Deleting static/mcsinterface/ folders") + app.logger.info(f'{"Deleting static/mcsinterface/ folders"}') os.system("find ./static/mcsinterface -name 'cmd_*' | xargs rm -r") os.system("find ./static/mcsinterface -name 'output_*' | xargs rm -r") # TODO: os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r") From e9d20cf9529eb2f45a370e120e5d515babbfe2f8 Mon Sep 17 00:00:00 2001 From: natedeml <74742644+NDCACI@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:20:26 -0500 Subject: [PATCH 4/5] Update mcsweb.py --- webenabled/mcsweb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webenabled/mcsweb.py b/webenabled/mcsweb.py index f01b9e29..aef86a1f 100644 --- a/webenabled/mcsweb.py +++ b/webenabled/mcsweb.py @@ -222,7 +222,7 @@ def exit_unity(): app.logger.info(f'{"Deleting static/mcsinterface/ folders"}') os.system("find ./static/mcsinterface -name 'cmd_*' | xargs rm -r") os.system("find ./static/mcsinterface -name 'output_*' | xargs rm -r") - # TODO: os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r") + os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r") return resp From fab805b483887f80ee776abc56af3bdb4adefdf1 Mon Sep 17 00:00:00 2001 From: natedeml <74742644+NDCACI@users.noreply.github.com> Date: Tue, 12 Dec 2023 11:17:35 -0500 Subject: [PATCH 5/5] Update runner_script.py --- machine_common_sense/scripts/runner_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machine_common_sense/scripts/runner_script.py b/machine_common_sense/scripts/runner_script.py index a8440176..cf7e313e 100644 --- a/machine_common_sense/scripts/runner_script.py +++ b/machine_common_sense/scripts/runner_script.py @@ -68,7 +68,7 @@ def __init__( ) if args.save_videos: subprocess.call([ - 'ffmpeg', '-y', '-r', '20', '-i', '-q:v', '1', + 'ffmpeg', '-y', '-r', '20', '-i', scene_name + '/frame_image_%d.png', '-vcodec', 'h264', '-vf', 'format=yuv420p', scene_name + '.mp4'