Commit 833b502f authored by norvell's avatar norvell
Browse files

Updates for parse_commands.py and split renderer logging of REF decoder commands

parent b6d649fd
Loading
Loading
Loading
Loading
Loading
+36 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

import argparse
import re
import json
from os import path
from pathlib import Path
import glob
@@ -28,6 +29,37 @@ if __name__ == '__main__':
        cmds_rend = re.findall(r'Running command\s*\n\s*(\S.*)', report, re.MULTILINE)
        cmds_isar_post_rend = re.findall(r'Running ISAR post renderer command\s*\n\s*(\S.*)', report, re.MULTILINE)


        if all(not x for x in [cmds_enc, cmds_dec, cmds_rend, cmds_isar_post_rend]):
            lines = re.split(r'\\n', report)
            enc_cmd = False
            dec_cmd = False
            rend_cmd = False
            isar_post_rend_cmd = False
            for line in lines:
                line = line.split("<br/>")[0].replace('\\t','') # Remove trailing html tags
                if enc_cmd:
                    cmds_enc.append(line)
                    enc_cmd = False
                elif dec_cmd:
                    cmds_dec.append(line)
                    dec_cmd = False
                elif rend_cmd:
                    cmds_rend.append(line)
                    rend_cmd = False                         
                elif isar_post_rend_cmd:
                    cmds_isar_post_rend.append(line)
                    isar_post_rend_cmd = False                        
                else:
                    if "REF encoder command" in line:
                        enc_cmd = True
                    elif "REF decoder command" in line:
                        dec_cmd = True
                    elif "Running command" in line:
                        rend_cmd = True                             
                    elif "Running ISAR post renderer command" in line:
                        isar_post_rend_cmd = True                                             

    # Remove HTML tags
    cmds_rend = [x.split('<')[0] for x in cmds_rend]
    cmds_isar_post_rend = [x.split('<')[0] for x in cmds_isar_post_rend]
@@ -138,10 +170,10 @@ if __name__ == '__main__':
                args.append(arg)
            cmd = ' '.join(args)

            if "cut" in cmd:
            if "ref" in cmd:
                outfile.write(cmd+'\n')
            out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd)
            if out and "cut" in out.group(1):
            if out and "ref" in out.group(1):
                outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer/cut',REF_PATH + r'/renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n')
                outfile.write('\n')            
        with open('scripts/script_footer.txt','r') as footer:
@@ -164,10 +196,10 @@ if __name__ == '__main__':
                args.append(arg)
            cmd = ' '.join(args)

            if "cut" in cmd:
            if "ref" in cmd:
                outfile.write(cmd+'\n')
            out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd)
            if out and "cut" in out.group(1):
            if out and "ref" in out.group(1):
                outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n')
                outfile.write('\n')            
        with open('scripts/script_footer.txt','r') as footer:
+4 −1
Original line number Diff line number Diff line
@@ -109,6 +109,9 @@ def run_ivas_isar_enc_cmd(cmd, env=None):


def run_ivas_isar_dec_cmd(cmd, env=None):
    if BIN_SUFFIX_MERGETARGET in cmd[0]:
        logging.info(f"\nREF decoder command:\n\t{' '.join(cmd)}\n")
    else:
        logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n")
    _run_cmd(cmd, env)