All pastes #28612 Raw Edit

krepos

public text v1 · immutable
#28612 ·published 2005-11-13 22:48 UTC
rendered paste body
def move(availableList, installedList, currentSelection, debug):
    if currentSelection in availableList:
        availableList.remove(currentSelection)
        installedList.append(currentSelection)
    elif currentSelection in installedList:
        installedList.remove(currentSelection)
        installedList.append(currentSelection)
        return (availableList, installedList)
    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)