forked from ARL-UTEP-OC/cdes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_session_reader.py
32 lines (26 loc) · 952 Bytes
/
test_session_reader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3
import xml.etree.ElementTree as ET
import logging
import os
import json
import sys, traceback
from COREIfx import msg_ifx
from COREIfx.imnparser import imnparser
from pyparsing import nestedExpr, originalTextFor
from COREIfx.session_reader import SessionReader
__author__ = "Jaime C. Acosta"
__license__ = "GPL 3.0"
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
logging.debug("SessionReader(): instantiated")
if len(sys.argv) < 2:
logging.error("Usage: python test_session_reader.py <session-number>")
exit()
sr = SessionReader(sys.argv[1])
logging.debug("Printing All")
state = sr.get_session_state
logging.debug("Current session state: " + str(state))
if state == None:
logging.debug("Exiting since session data is not available: " + str(state))
exit()
logging.debug(json.dumps(sr.relevant_session_to_JSON(), indent=3))