def process_neo4j(args):

    # Get family data of the person
    try:

        main_person = Person()
        main_person.handle = args.handle1

        taapeli_person = Person()
        taapeli_person.handle = args.handle2

        # The fetching of the family and parents data of the main person is
        # split to two operations:
        #
        # If there are no parents in the db the result of
        # get_parentin_handle() operation is empty,
        # but the get_family_data operation prints out
        # the family of the main person.
        result = main_person.get_parentin_handle()
        for record in result:
            main_parents_hlink = record["parentin_hlink"]

            result = taapeli_person.get_parentin_handle()
            for record in result:
                taapeli_parents_hlink = record["parentin_hlink"]
                compare_parents_data(main_parents_hlink, taapeli_parents_hlink)

        compare_family_data(main_person, taapeli_person)

    except Exception as err:
        print("Virhe: {0}".format(err), file=stderr)
Exemple #2
0
def process_neo4j(args):

    # Get family data of the person
    global points

    try:
        main_person = Person()
        main_person.handle = args.handle1

        taapeli_person = Person()
        taapeli_person.handle = args.handle2

        if args.print_out == "True":
            print_out = True
        else:
            print_out = False

        # The fetching of the family and parents data of the main person is
        # split to two operations:
        #
        # If there are no parents in the db the result of
        # get_parentin_handle() operation is empty,
        # but the get_family_data operation prints out
        # the family of the main person.
        result = main_person.get_parentin_handle()
        for record in result:
            main_parents_hlink = record["parentin_hlink"]

            result = taapeli_person.get_parentin_handle()
            for record in result:
                taapeli_parents_hlink = record["parentin_hlink"]
                compare_parents_data(main_parents_hlink, taapeli_parents_hlink,
                                     print_out)

        compare_family_data(main_person, taapeli_person, print_out)

        print("=== === Total points: " + str(points) + " === ===")

    except Exception as err:
        print("Virhe: {0}".format(err), file=stderr)