def put_orbs(args): orblist = take_orbs(args[0]) comps = propdb.get_comps() comp_id = None for cid, cname, ctime in comps: if args[1].upper() == cname: comp_id = cid break if comp_id is None: raise KeyError("There is no such comp in database") for n, en, orbtype in orblist: propdb.add_orb(n, en, orbtype, comp_id)
def print_comps(actions): for row in propdb.get_comps(): print "\t".join(str(c) for c in row)