Ejemplo n.º 1
0
def main(args):
    if not os.path.exists(args.server_stream):
        Log.error("server_stream file not exist.")
        return

    Log.info("Start parsing iSmartAlarm diagnotics stream...")

    isap = ISADiagnoticsStreamParser(args.server_stream)
    unstructured_log = isap.get_unstructured_log()
    sensor_log = isap.get_sensor_log()

    with Elastic(index='unstructured_log',
                 doc_type='unstructured_log') as elastic:
        datetime_log = []

        for log in unstructured_log:
            if 'data_type' in log.keys():
                if log['data_type'] == 'datetime':
                    datetime_log.append(log)
        elastic.upload(datetime_log, 'data')

    with Elastic(index='sensor_log', doc_type='sensor_log') as elastic:
        elastic.upload(sensor_log, 'datetime')

    Log.info("Successfully upload server_stream data.")

    del isap
Ejemplo n.º 2
0
def main(args):
    """Main method for parsing dairies."""
    if not os.path.exists(args.database):
        Log.error("iSmartAlarm.DB file not found.", trace_exc=False)
        return

    dp = DairyParser(args.database)
    dp.parse()
    del dp
Ejemplo n.º 3
0
def main(args):
    """Main method for parsing dairies."""
    if not os.path.exists(args.database):
        Log.error("persistenceDB file not found.", trace_exc=False)
        return

    wap = WinkActivityParser(args.database)
    wap.parse()
    del wap
Ejemplo n.º 4
0
def main(args):
    """Main method for parsing activities."""
    if not os.path.exists(args.database):
        Log.error("cift_amazon_alexa.db file not found.", trace_exc=False)
        return

    cdp = CIFTDatabaseParser(args.database, args.timezone)
    cdp.parse()
    del cdp
Ejemplo n.º 5
0
def main(args):
    """Main method for recovering video."""
    # if frame_database file not found
    if not os.path.exists(args.database):
        Log.error("frame_database file not found.", trace_exc=False)
        return

    ve = VideoExtractor(args.database, args.output)
    ve.extract(args.merge, args.frame, args.add_timeline)
    del ve