def old_method_from_file():
    val = False
    pu = PathUnique()
    source_fn = old_file_chooser()
    pre = False
    if len(args) > 1:
        pre = True
    comp_move = open("L:\\Intranet\\ar\Digital_Services\\Inventory\\002_TO_BE_MOVED\\{}".format(source_fn), "r")
    moved_file_name = source_fn.split(".")[0]
    moved = "L:\\Intranet\\ar\\Digital_Services\\Inventory\\004_COMPLETED\\{}_MOVED.tsv".format(moved_file_name)
    not_moved = "L:\\Intranet\\ar\\Digital_Services\\Inventory\\003_NEEDS_REVIEW\\{}_REVIEW.tsv".format(moved_file_name)
    lines = []
    item_list = []

    for f in comp_move.readlines():
        l = f.strip().split("\t")
        if not pre:
            pi = PItem(l, False)
            pr = pi.get_p_root()
            if val:
                if pu.is_unique(pr):
                    item_list.append(pi)
                else:
                    print("NOT UNIQUE: {}\t{}".format(pi.current_location, pr))
                    sys.exit(-1)
            else:
                item_list.append(pi)
        else:
            p = PItem(l, True)
            p.p_location = l[1]
            p.current_location = l[0]
            item_list.append(p)
    if val:
        pu.save()
    mv = Mover(item_list, comp_move.name)
    mv.moved_log = moved
    mv.not_moved_log = not_moved
    mv.start_move()
Exemple #2
0
    lines = []
    item_list = []

    for f in comp_move.readlines():
        l = f.strip().split("\t")
        if not pre:
            pi = PItem(l, False)
            pr = pi.get_p_root()
            if val:
                if pu.is_unique(pr):
                    item_list.append(pi)
                else:
                    print("NOT UNIQUE: {}\t{}".format(pi.current_location, pr))
                    sys.exit(-1)
            else:
                item_list.append(pi)
        else:
            p = PItem(l, True)
            p.p_location = l[1]
            p.current_location = l[0]
            item_list.append(p)
    if val:
        pu.save()
    mv = Mover(item_list, comp_move.name)
    mv.moved_log = moved
    mv.not_moved_log = not_moved
    mv.start_move()