From 4f8d2d1567f87ed11b27eb5043b16e25d01849b9 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 27 Mar 2025 07:28:37 +0000 Subject: [PATCH] fixedLPPauditing --- .../management/commands/custom_runserver.py | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/kitchen_counter/conversion/management/commands/custom_runserver.py b/kitchen_counter/conversion/management/commands/custom_runserver.py index c994d9d..1ff5212 100755 --- a/kitchen_counter/conversion/management/commands/custom_runserver.py +++ b/kitchen_counter/conversion/management/commands/custom_runserver.py @@ -166,32 +166,47 @@ def lpp_audit(msg): aws_access_key_id="AKIAQVLBBGCB45RMLKVW", aws_secret_access_key="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", region_name="ap-south-1") - print("outputs1", outputfile, local_file_path) - print("outputs2", originalfile, original_file) + print("outputs1 : ", outputfile,"\n" ,local_file_path) + print("outputs2 : ", originalfile,"\n", original_file) s3_client.download_file("conversion-kitchen", outputfile, local_file_path) s3_client.download_file("conversion-kitchen", originalfile, original_file) print("ran till here 4") try: language_code = "en" + print("above os.path.basename") + input_file = os.path.basename(local_file_path) + print(f"{input_file =}") + input_file1 = os.path.splitext(input_file)[0] + screenplay_name = input_file1 +"_LppVetted" + print(f"{screenplay_name =}") + script_file = local_file_path + script_ext = script_file.split(".")[-1] + print(f"{script_ext =}") + script_file_name = screenplay_name + "." + script_ext + print(f"{script_file_name =}") + # name_script = (str(local_file_path).split("."))[0] + "_vetted_a" + "." + (str(local_file_path).split("."))[1] filename = str(local_file_path).split("/")[-1] - name_script = filename.split("_vetted_a")[0] + name_script = filename.split("_vetted_a")[0].rsplit(".", 1)[0] doc_file = f"{local_file_path}" file1 = ContentFile( open(doc_file, 'rb').read(), - (doc_file.split("/"))[-1], + script_file_name, ) + print("going inside result") result = filesystem.new_screenplay_without_audit_in_background( file_user, - file_user.username, - str(name_script), + str(file_user.username), + str(screenplay_name), file1, "script-original", language_code, ) + name_script = str(screenplay_name) print("already called", result) audit_id = result.get("script", {}).get("id") print("ran till here 10") + print(f"{audit_id =}") if audit_id is not None: objectt = ScriptTranslations.objects.get(translation_id=lpp_user.translated_script.translation_id) @@ -229,6 +244,7 @@ def lpp_audit(msg): except Exception as e: print("Error in auditing vetted output is", e) print("ran till here 11") + print(audit_id) """Blockchain Upload Starts here""" # sys.stdout = original_stdout status = ScriptAuditModel.objects.get(