Esempio n. 1
0
 def get_transitions(self):
     for i in self.list_days:
         for h in self.get_files_per_day(i):
             print("Downloading file: " + h)
             self.download_file(i, h)
             print("\tProcessing data")
             self.data_process(self.data_files_map[h])
             aux_f = open("model_aux.xml", "w")
             aux_f.write(createSCXML(self.log.transitions))
             aux_f.flush()
             aux_f.close()
             for x in self.log.transitions:
                 print(x)
     return self.log.transitions
Esempio n. 2
0
#!/usr/bin/env python2
import sys

from optparse import OptionParser
import logworld
from scxmlGen import createSCXML

parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
                  help="JSON Log translate document", metavar="JSON")
parser.add_option("-v", "--verbose", action="store_false", dest="verbose",
                  help="Show data from transitions")

(options, args) = parser.parse_args()

if options.filename is None:
    print("Option --file is required")

log = logworld.LogWorld(options.filename)

for line in sys.stdin:
    log.logDispatcher(line)


if options.verbose is None:
    print(createSCXML(log.transitions))
else:
    for x in log.transitions:
        print(x)
Esempio n. 3
0
#!/usr/bin/env python2
from datetime import date
from xml_log_processor import XMLLogProcessor
import sys

from scxmlGen import createSCXML

date_from = date(2016, 3, 23)
date_to = date(2016, 3, 24)
jsonfile = "../../models/states.json"

if len(sys.argv) > 1:
    jsonfile = sys.argv[1]


print ("Reading File: " + jsonfile)
print ("Date from - to:")
print (date_from)
print (date_to)

processor = XMLLogProcessor(date_from, date_to, jsonfile)

transitions = processor.get_transitions()

for i in transitions:
    print(i)

print(createSCXML(transitions))