All pastes #28613 Raw Edit

Stuff

public text v1 · immutable
#28613 ·published 2005-11-13 23:11 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)