Exemple #1
0
def do_work(parents):
    global db
    connect(db_name)
    for parent in parents:
        start = datetime.now()
        if not parent in db:
            print ("Parent not found in db: "+parent)
            continue
        for decay in db[parent]:
            work_copy = deepcopy(decay)
            #work_copy['history'] = "{} --> {}".format(
            #    parent, ' '.join(decay['products']))

            get_fstates(work_copy)

        end = datetime.now()

        print "{}\t{}".format(parent, end-start)
Exemple #2
0
def do_work(fathers):
    global db
    connect(db_name)
    for father in fathers:
        start = datetime.now()
        if not father in db:
            print ("Father not found in db: "+father)
            continue
        for decay in db[father]:
            work_copy = deepcopy(decay)
            work_copy['history'] = "{} --> {}".format(
                father, ' '.join(decay['products']))

            get_fstates(work_copy)

        end = datetime.now()

        print "{}\t{}".format(father, end-start)