Commit 1ab35db0 authored by YannGarcia's avatar YannGarcia
Browse files

Add log viewer based on plantuml

parent 90078a7a
Loading
Loading
Loading
Loading
+106 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="984.375px" preserveAspectRatio="none" style="width:1284px;height:984px;background:#FFFFFF;" version="1.1" viewBox="0 0 1284 984" width="1284.375px" zoomAndPan="magnify"><defs/><g><rect fill="#ADD8E6" height="871.875" style="stroke:#A80036;stroke-width:3.125;" width="287.5" x="828.125" y="93.75"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="290.625" x="826.5625" y="116.9556">TTCN-3 Environment</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="534.375" x="642.1875" y="60.7056">TC_MEC_MEC013_SRV_UELOCSUB_001_OK</text><line style="stroke:#000080;stroke-width:3.125;stroke-dasharray:5.0,5.0;" x1="365.625" x2="365.625" y1="215.625" y2="946.875"/><line style="stroke:#000080;stroke-width:3.125;stroke-dasharray:5.0,5.0;" x1="971.875" x2="971.875" y1="215.625" y2="946.875"/><rect fill="#4169E1" height="75" style="stroke:#000080;stroke-width:4.6875;" width="143.75" x="293.75" y="137.5"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="100" x="315.625" y="182.5806">system</text><rect fill="#4169E1" height="75" style="stroke:#000080;stroke-width:4.6875;" width="231.25" x="856.25" y="137.5"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="187.5" x="878.125" y="182.5806">mtc:httpPort</text><polygon fill="#708090" points="400,278.125,368.75,290.625,400,303.125,387.5,290.625" style="stroke:#708090;stroke-width:3.125;"/><line style="stroke:#708090;stroke-width:3.125;stroke-dasharray:2.0,2.0;" x1="381.25" x2="968.75" y1="290.625" y2="290.625"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="18.75" x="418.75" y="276.3306">1</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="56.25" x="450" y="276.3306">map</text><polygon fill="#008000" points="400,353.125,368.75,365.625,400,378.125,387.5,365.625" style="stroke:#008000;stroke-width:3.125;"/><line style="stroke:#008000;stroke-width:3.125;" x1="381.25" x2="968.75" y1="365.625" y2="365.625"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="18.75" x="418.75" y="351.3306">2</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="500" x="450" y="351.3306">@LibHttp_TypesAndValues.HttpMessage</text><path d="M987.5,331.25 L987.5,393.75 L1240.625,393.75 L1240.625,362.5 L1209.375,331.25 L987.5,331.25 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M1209.375,331.25 L1209.375,362.5 L1240.625,362.5 L1209.375,331.25 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><a href="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt" target="_top" title="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt" xlink:actuate="onRequest" xlink:href="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt" xlink:show="new" xlink:title="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt" xlink:type="simple"><text fill="#0000FF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" text-decoration="underline" textLength="187.5" x="1006.25" y="370.0806">request := ...</text></a><path d="M31.25,331.25 L31.25,393.75 L350,393.75 L350,362.5 L318.75,331.25 L31.25,331.25 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M318.75,331.25 L318.75,362.5 L350,362.5 L318.75,331.25 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="50" y="370.0806">14:11:47.542719</text><line style="stroke:#708090;stroke-width:3.125;" x1="971.875" x2="1103.125" y1="459.375" y2="459.375"/><line style="stroke:#708090;stroke-width:3.125;" x1="1103.125" x2="1103.125" y1="459.375" y2="500"/><line style="stroke:#708090;stroke-width:3.125;" x1="975" x2="1103.125" y1="500" y2="500"/><polygon fill="#708090" points="1006.25,487.5,975,500,1006.25,512.5,993.75,500" style="stroke:#708090;stroke-width:3.125;"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="18.75" x="993.75" y="445.0806">3</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="231.25" x="1025" y="445.0806">Start, duration: 30</text><path d="M637.5,425 L637.5,487.5 L956.25,487.5 L956.25,456.25 L925,425 L637.5,425 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M925,425 L925,456.25 L956.25,456.25 L925,425 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="656.25" y="463.8306">14:11:47.546267</text><polygon fill="#008000" points="934.375,562.5,965.625,575,934.375,587.5,946.875,575" style="stroke:#008000;stroke-width:3.125;"/><line style="stroke:#008000;stroke-width:3.125;" x1="365.625" x2="953.125" y1="575" y2="575"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="18.75" x="387.5" y="560.7056">4</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="500" x="418.75" y="560.7056">@LibHttp_TypesAndValues.HttpMessage</text><path d="M987.5,540.625 L987.5,603.125 L1262.5,603.125 L1262.5,571.875 L1231.25,540.625 L987.5,540.625 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M1231.25,540.625 L1231.25,571.875 L1262.5,571.875 L1231.25,540.625 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><a href="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt" target="_top" title="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt" xlink:actuate="onRequest" xlink:href="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt" xlink:show="new" xlink:title="file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt" xlink:type="simple"><text fill="#0000FF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" text-decoration="underline" textLength="209.375" x="1006.25" y="579.4556">response := ...</text></a><path d="M31.25,540.625 L31.25,603.125 L350,603.125 L350,571.875 L318.75,540.625 L31.25,540.625 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M318.75,540.625 L318.75,571.875 L350,571.875 L318.75,540.625 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="50" y="579.4556">14:11:47.607302</text><line style="stroke:#708090;stroke-width:3.125;" x1="971.875" x2="1103.125" y1="668.75" y2="668.75"/><line style="stroke:#708090;stroke-width:3.125;" x1="1103.125" x2="1103.125" y1="668.75" y2="709.375"/><line style="stroke:#708090;stroke-width:3.125;" x1="975" x2="1103.125" y1="709.375" y2="709.375"/><polygon fill="#708090" points="1006.25,696.875,975,709.375,1006.25,721.875,993.75,709.375" style="stroke:#708090;stroke-width:3.125;"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="18.75" x="993.75" y="654.4556">5</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="228.125" x="1025" y="654.4556">Stop, duration: 30</text><path d="M637.5,634.375 L637.5,696.875 L956.25,696.875 L956.25,665.625 L925,634.375 L637.5,634.375 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M925,634.375 L925,665.625 L956.25,665.625 L925,634.375 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="656.25" y="673.2056">14:11:47.608497</text><path d="M637.5,634.375 L637.5,696.875 L956.25,696.875 L956.25,665.625 L925,634.375 L637.5,634.375 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M925,634.375 L925,665.625 L956.25,665.625 L925,634.375 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="656.25" y="673.2056">14:11:47.608862</text><path d="M637.5,634.375 L637.5,696.875 L956.25,696.875 L956.25,665.625 L925,634.375 L637.5,634.375 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M925,634.375 L925,665.625 L956.25,665.625 L925,634.375 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="656.25" y="673.2056">14:11:47.609283</text><polygon fill="#708090" points="400,771.875,368.75,784.375,400,796.875,387.5,784.375" style="stroke:#708090;stroke-width:3.125;"/><line style="stroke:#708090;stroke-width:3.125;stroke-dasharray:2.0,2.0;" x1="381.25" x2="968.75" y1="784.375" y2="784.375"/><text fill="#000000" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="18.75" x="418.75" y="770.0806">6</text><text fill="#000000" font-family="sans-serif" font-size="25" lengthAdjust="spacing" textLength="87.5" x="450" y="770.0806">unmap</text><path d="M31.25,750 L31.25,812.5 L350,812.5 L350,781.25 L318.75,750 L31.25,750 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><path d="M318.75,750 L318.75,781.25 L350,781.25 L318.75,750 " fill="#696969" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="253.125" x="50" y="788.8306">14:11:47.610574</text><polygon fill="#FF0000" points="303.125,843.75,1034.375,843.75,1065.625,871.875,1034.375,900,303.125,900,271.875,871.875,303.125,843.75" style="stroke:#000000;stroke-width:3.125;"/><text fill="#FFFFFF" font-family="sans-serif" font-size="25" font-weight="bold" lengthAdjust="spacing" textLength="43.75" x="646.875" y="879.4556">fail</text><!--MD5=[39af4d96147b4d656cef41c6c04880ef]
@startuml
title TC_MEC_MEC013_SRV_UELOCSUB_001_OK
/'Editor: https://plantuml-editor.kkeisuke.com/ '/
/'Syntax: http://plantuml.com/fr/sequence-diagram '/
!include etsi-style.iuml
!pragma teoz true
autonumber
participant system
box "TTCN-3 Environment" #LightBlue
participant "mtc:httpPort"
endbox
"mtc:httpPort" - -> system: map
"mtc:httpPort" -[#green]> system: @LibHttp_TypesAndValues.HttpMessage
note right: [[file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt request := ...]]
note left: 14:11:47.542719
"mtc:httpPort" -> "mtc:httpPort": Start, duration: 30
note left: 14:11:47.546267
system -[#green]> "mtc:httpPort": @LibHttp_TypesAndValues.HttpMessage
note right: [[file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt response := ...]]
note left: 14:11:47.607302
"mtc:httpPort" -> "mtc:httpPort": Stop, duration: 30
note left: 14:11:47.608497
note left: 14:11:47.608862
note left: 14:11:47.609283
"mtc:httpPort" - -> system: unmap
hnote across #red: fail
note left: 14:11:47.610574
@enduml

@startuml
title TC_MEC_MEC013_SRV_UELOCSUB_001_OK
hide footbox
autonumber
skinparam {
    dpi 300
    shadowing false
    defaultFontSize 8
}

skinparam note {
    FontSize 8
    FontStyle bold
    FontColor White
    borderColor Black
    backgroundColor DimGray
}

skinparam participant {
    FontSize 8
    FontStyle bold
    FontColor White
    borderColor Navy
    backgroundColor RoyalBlue
}

skinparam actor {
    FontSize 8
    FontStyle bold
    FontColor Navy
    borderColor Navy
    backgroundColor RoyalBlue
}

skinparam sequence {
    ArrowFontColor Black
    ArrowColor SlateGray
    LifeLineBorderColor Navy
    LifeLineBackgroundColor DimGray
}

skinparam ParticipantPadding 5
skinparam BoxPadding 5

!pragma teoz true
autonumber
participant system
box "TTCN-3 Environment" #LightBlue
participant "mtc:httpPort"
endbox
"mtc:httpPort" - -> system: map
"mtc:httpPort" -[#green]> system: @LibHttp_TypesAndValues.HttpMessage
note right: [[file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt request := ...]]
note left: 14:11:47.542719
"mtc:httpPort" -> "mtc:httpPort": Start, duration: 30
note left: 14:11:47.546267
system -[#green]> "mtc:httpPort": @LibHttp_TypesAndValues.HttpMessage
note right: [[file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt response := ...]]
note left: 14:11:47.607302
"mtc:httpPort" -> "mtc:httpPort": Stop, duration: 30
note left: 14:11:47.608497
note left: 14:11:47.608862
note left: 14:11:47.609283
"mtc:httpPort" - -> system: unmap
hnote across #red: fail
note left: 14:11:47.610574
@enduml

PlantUML version 1.2021.9(Sun Jul 25 12:13:56 CEST 2021)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>
 No newline at end of file
+28 −0
Original line number Original line Diff line number Diff line
@startuml
title TC_MEC_MEC013_SRV_UELOCSUB_001_OK
/'Editor: https://plantuml-editor.kkeisuke.com/ '/
/'Syntax: http://plantuml.com/fr/sequence-diagram '/
!include etsi-style.iuml
!pragma teoz true
autonumber
participant system
box "TTCN-3 Environment" #LightBlue
participant "mtc:httpPort"
endbox
"mtc:httpPort" --> system: map
"mtc:httpPort" -[#green]> system: @LibHttp_TypesAndValues.HttpMessage
note right: [[file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_542719.txt request := ...]]
note left: 14:11:47.542719
"mtc:httpPort" -> "mtc:httpPort": Start, duration: 30
note left: 14:11:47.546267
system -[#green]> "mtc:httpPort": @LibHttp_TypesAndValues.HttpMessage
note right: [[file:///home/yann/dev/gs032p3-ttcn-test-suite/plantuml/msgs/14_11_47_607302.txt response := ...]]
note left: 14:11:47.607302
"mtc:httpPort" -> "mtc:httpPort": Stop, duration: 30
note left: 14:11:47.608497
note left: 14:11:47.608862
note left: 14:11:47.609283
"mtc:httpPort" --> system: unmap
hnote across #red: fail
note left: 14:11:47.610574
@enduml

plantuml/README.md

0 → 100644
+0 −0

Empty file added.

plantuml/__main__.py

0 → 100644
+180 −0
Original line number Original line Diff line number Diff line
# -*- Coding: utf-8 -*-

from __future__ import division # Import floating-point division (1/4=0.25) instead of Euclidian division (1/4=0)

import os
import glob
import sys
import logging

from regex_list import *

MSG_PATH = ""
IN_FILE_PATH = ""
OUT_FILE_PATH = ""
out_streams = object()
logger = object()
parser = object()
data_ctx = dict()

def process_command_line_args():
    global IN_FILE_PATH

    print(f"Arguments count: {len(sys.argv)}")
    for i, arg in enumerate(sys.argv):
        print(f"Argument {i:>6}: {arg}")
    IN_FILE_PATH = sys.argv[1]
    # End of function process_command_line_args

def process_line(line):
    global MSG_PATH, out_streams, logger, parser, data_ctx

    match = parser.parse_line(line)
    if match != None:
        logger.info(f"Matching: {match}")
        if 'testcase' in match:
            logger.info('Got testcase')
            out_streams.write('@startuml\n')
            out_streams.write(f"title {match['testcase']}\n")
            out_streams.write("/'Editor: https://plantuml-editor.kkeisuke.com/ '/\n")
            out_streams.write("/'Syntax: http://plantuml.com/fr/sequence-diagram '/\n")
            out_streams.write('!include etsi-style.iuml\n')
            out_streams.write('!pragma teoz true\n')
            out_streams.write('autonumber\n')
            out_streams.write('participant system\n')
            out_streams.write('box "TTCN-3 Environment" #LightBlue\n')
        elif 'operation' in match:
            logger.info('Got operation')
            if match['operation'] == 'mapped':
                out_streams.write(f"participant \"{match['comp']}:{match['protocol_port']}\"\n")
                data_ctx['protocol_port'].append(f"{match['comp']}:{match['protocol_port']}")
            else:
                if match['protocol_port'] != 'syncPort':
                    out_streams.write(f"\"{match['comp']}:{match['protocol_port']}\" --> system: unmap\n")
        elif 'request' in match:
            logger.info('Got request')
            if data_ctx['box_ended'] == False:
                out_streams.write('endbox\n')
                data_ctx['box_ended'] = True
                for p in data_ctx['protocol_port']:
                    out_streams.write(f"\"{p}\" --> system: map\n")
            out_streams.write(f"\"{match['comp']}:{match['port']}\" -[#green]> system: @{match['module']}.{match['message']}\n")
            s =  match['request'].replace(",", ",\\n").replace("\"", "").strip()
            if len(s) > 128:
                n = match['hours'] + "_" + match['minutes'] + "_" + match['seconds'] + "_" + match['milliseconds'] + ".txt"
                n = os.path.join(MSG_PATH, n)
                with open(n, "w") as msg:
                    msg.write(s)
                s = f'[[file://{n} request := ...]]' #{Click to read the message}
            out_streams.write(f"note right: {s}\n")
            out_streams.write(f"note left: {match['hours']}:{match['minutes']}:{match['seconds']}.{match['milliseconds']}\n")
        elif 'response' in match:
            logger.info('Got response')
            if data_ctx['box_ended'] == False:
                out_streams.write('endbox\n')
                data_ctx['box_ended'] = True
            out_streams.write(f"system -[#green]> \"{match['comp']}:{match['port']}\": @{match['module']}.{match['message']}\n")
            s = match['response'].replace(",", ",\\n").replace("\"", "").strip()
            if len(s) > 128:
                n = match['hours'] + "_" + match['minutes'] + "_" + match['seconds'] + "_" + match['milliseconds'] + ".txt"
                n = os.path.join(MSG_PATH, n)
                with open(n, "w") as msg:
                    msg.write(s)
                s = f'[[file://{n} response := ...]]' #{Click to read the message}
            out_streams.write(f"note right: {s}\n")
            out_streams.write(f"note left: {match['hours']}:{match['minutes']}:{match['seconds']}.{match['milliseconds']}\n")
        elif 'timer_name' in match:
            logger.info('Got timer')
            if match['timer_name'] == 'tc_sync':
                pass
            else:
                for p in data_ctx['protocol_port']:
                    if p.startswith(match['comp']):
                        out_streams.write(f"\"{p}\" -> \"{p}\": {match['start_stop']}, duration: {match['duration']}\n")
                        break
            out_streams.write(f"note left: {match['hours']}:{match['minutes']}:{match['seconds']}.{match['milliseconds']}\n")
        elif 'verdict' in match:
            logger.info('Got verdict')
            if 'ptcid' in match and match['ptcid'] != None:
                s = match['ptcid'].split('(')
                s = s[1].split(')')
                for p in data_ctx['protocol_port']:
                    if p.startswith(s[0]):
                        if match['verdict'] == 'fail':
                            out_streams.write(f"hnote over \"{p}\" #red: fail\n")
                        elif match['verdict'] == 'pass':
                            out_streams.write(f"hnote over \"{p}\" #green: pass\n")
                        elif match['verdict'] == 'inconc':
                            out_streams.write(f"hnote across #yellow: inconc\n")
                        else:
                            out_streams.write(f"hnote over \"{p}\" #gray: error\n")
                        out_streams.write(f"note left: {match['hours']}:{match['minutes']}:{match['seconds']}.{match['milliseconds']}\n")
                        break
        elif 'final_verdict' in match:
            logger.info('Got verdict')
            if match['final_verdict'] == 'fail':
                out_streams.write(f"hnote across #red: fail\n")
            elif match['final_verdict'] == 'pass':
                out_streams.write(f"hnote across #green: pass\n")
            elif match['final_verdict'] == 'inconc':
                out_streams.write(f"hnote across #yellow: inconc\n")
            else:
                out_streams.write(f"hnote across #gray: error\n")
            out_streams.write(f"note left: {match['hours']}:{match['minutes']}:{match['seconds']}.{match['milliseconds']}\n")
            out_streams.write('@enduml\n')
        else:
            logger.info('Got unsupported item')
        # End of 'if' statement
        out_streams.flush()
    # End of function process_line

def main():
    global MSG_PATH, OUT_FILE_PATH, out_streams, logger, parser, data_ctx

    process_command_line_args()

    # Initialize the logger
    logger = logging.getLogger(__name__)
    logger.setLevel(logging.DEBUG)
    l = logging.StreamHandler()
    l.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
    logger.addHandler(l)

    # Prepare outputs
    OUT_FILE_PATH = sys.argv[2]
    CURRENT_PATH = os.getcwd()
    MSG_PATH = os.path.join(CURRENT_PATH, "msgs")
    logger.info(f'CURRENT_PATH:{CURRENT_PATH} - MSG_PATH{MSG_PATH}')
    if os.path.exists(MSG_PATH):
        files = glob.glob(os.path.join(MSG_PATH, '*'))
        for f in files:
            os.remove(f)
    else:
        os.mkdir(MSG_PATH)
    
    # Setup the regex
    parser = regex_list(logger)
    parser.reset_state()

    data_ctx = dict()
    data_ctx['protocol_port'] = []
    data_ctx['box_ended'] = False

    print(f"IN_FILE_PATH= {IN_FILE_PATH}")
    with open(IN_FILE_PATH, "r") as in_stream:
        with open(OUT_FILE_PATH, "w") as out_streams:
            line = in_stream.readline()
            while line != '':
                process_line(line)
                line = in_stream.readline()
            # End of 'for' statement
        # End of 'with' statement
    # End of 'with' statement

    os.system('java -DPLANTUML_LIMIT_SIZE=8192 -jar ./plantuml.jar -svg {}'.format(OUT_FILE_PATH))
# End of main function

if __name__ == "__main__":
    main()

# End of file
+4.72 KiB

File added.

No diff preview for this file type.

Loading