fixedLPPauditing
This commit is contained in:
parent
6b4b406f6c
commit
4f8d2d1567
|
@ -166,32 +166,47 @@ def lpp_audit(msg):
|
||||||
aws_access_key_id="AKIAQVLBBGCB45RMLKVW",
|
aws_access_key_id="AKIAQVLBBGCB45RMLKVW",
|
||||||
aws_secret_access_key="ZWc6KOc5LuBLuCEBDDfQTor+Q7rp3fFH74gVt+AA",
|
aws_secret_access_key="ZWc6KOc5LuBLuCEBDDfQTor+Q7rp3fFH74gVt+AA",
|
||||||
region_name="ap-south-1")
|
region_name="ap-south-1")
|
||||||
print("outputs1", outputfile, local_file_path)
|
print("outputs1 : ", outputfile,"\n" ,local_file_path)
|
||||||
print("outputs2", originalfile, original_file)
|
print("outputs2 : ", originalfile,"\n", original_file)
|
||||||
s3_client.download_file("conversion-kitchen", outputfile, local_file_path)
|
s3_client.download_file("conversion-kitchen", outputfile, local_file_path)
|
||||||
s3_client.download_file("conversion-kitchen", originalfile, original_file)
|
s3_client.download_file("conversion-kitchen", originalfile, original_file)
|
||||||
print("ran till here 4")
|
print("ran till here 4")
|
||||||
try:
|
try:
|
||||||
language_code = "en"
|
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]
|
# name_script = (str(local_file_path).split("."))[0] + "_vetted_a" + "." + (str(local_file_path).split("."))[1]
|
||||||
filename = 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}"
|
doc_file = f"{local_file_path}"
|
||||||
file1 = ContentFile(
|
file1 = ContentFile(
|
||||||
open(doc_file, 'rb').read(),
|
open(doc_file, 'rb').read(),
|
||||||
(doc_file.split("/"))[-1],
|
script_file_name,
|
||||||
)
|
)
|
||||||
|
print("going inside result")
|
||||||
result = filesystem.new_screenplay_without_audit_in_background(
|
result = filesystem.new_screenplay_without_audit_in_background(
|
||||||
file_user,
|
file_user,
|
||||||
file_user.username,
|
str(file_user.username),
|
||||||
str(name_script),
|
str(screenplay_name),
|
||||||
file1,
|
file1,
|
||||||
"script-original",
|
"script-original",
|
||||||
language_code,
|
language_code,
|
||||||
)
|
)
|
||||||
|
name_script = str(screenplay_name)
|
||||||
print("already called", result)
|
print("already called", result)
|
||||||
audit_id = result.get("script", {}).get("id")
|
audit_id = result.get("script", {}).get("id")
|
||||||
print("ran till here 10")
|
print("ran till here 10")
|
||||||
|
print(f"{audit_id =}")
|
||||||
if audit_id is not None:
|
if audit_id is not None:
|
||||||
|
|
||||||
objectt = ScriptTranslations.objects.get(translation_id=lpp_user.translated_script.translation_id)
|
objectt = ScriptTranslations.objects.get(translation_id=lpp_user.translated_script.translation_id)
|
||||||
|
@ -229,6 +244,7 @@ def lpp_audit(msg):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Error in auditing vetted output is", e)
|
print("Error in auditing vetted output is", e)
|
||||||
print("ran till here 11")
|
print("ran till here 11")
|
||||||
|
print(audit_id)
|
||||||
"""Blockchain Upload Starts here"""
|
"""Blockchain Upload Starts here"""
|
||||||
# sys.stdout = original_stdout
|
# sys.stdout = original_stdout
|
||||||
status = ScriptAuditModel.objects.get(
|
status = ScriptAuditModel.objects.get(
|
||||||
|
|
Loading…
Reference in New Issue