Ejemplo n.º 1
0
def runMethod(inputFile, outputFile, writer, options, further={}):
    further["app"] = os.path.split(__file__)[1]
    further["orig-ids"] = options.orig_ids
    further["ignore-gaps"] = options.ignore_gaps
    if options.base >= 0:
        further["base-date"] = datetime.datetime.fromtimestamp(options.base)
    else:
        further["base-date"] = datetime.datetime.now().replace(hour=0,
                                                               minute=0, second=0, microsecond=0)
    o = _getOutputStream(outputFile)
    if inputFile.isdigit():
        inp = getSocketStream(int(inputFile))
    else:
        inp = inputFile
    fcdStream = sumolib.output.parse(inp, "timestep")
    ret = writer(procFCDStream(fcdStream, options), o, further)
    _closeOutputStream(o)
    return ret
Ejemplo n.º 2
0
def runMethod(inputFile, outputFile, writer, options, further={}):
    further["app"] = os.path.split(__file__)[1]
    further["orig-ids"] = options.orig_ids
    further["ignore-gaps"] = options.ignore_gaps
    if options.base >= 0:
        further["base-date"] = datetime.datetime.fromtimestamp(options.base)
    else:
        further["base-date"] = datetime.datetime.now().replace(hour=0,
                                                               minute=0, second=0, microsecond=0)
    o = _getOutputStream(outputFile)
    if inputFile.isdigit():
        inp = getSocketStream(int(inputFile))
    else:
        inp = inputFile
    fcdStream = sumolib.output.parse(inp, "timestep")
    ret = writer(procFCDStream(fcdStream, options), o, further)
    _closeOutputStream(o)
    return ret