All pastes #28615 Raw Edit

Mine

public text v1 · immutable
#28615 ·published 2005-11-13 23:16 UTC
rendered paste body
def move(availableList, installedList, currentSelection, debug):
    if currentSelection in availableList:
        availableList.remove(currentSelection)
        installedList.append(currentSelection)
# Here
    elif currentSelection in installedList:
        installedList.remove(currentSelection)
        installedList.append(currentSelection)
# and here, depending on which list the selection is in, so that they dont affect each other.
    else:
        if debug == 1:
            sys.stderr.write("krepos.move: Current selection " + str(currentSelection) + " is not in availableList " + \
str(availableList) + " or installedList " + str(installedList) + "\n")
            sys.stderr.write("krepos.move: Aborting move, returning unchanged lists.")
    return (availableList, installedList)