()
Parse org_tasks dictionary for tasks and perform them
Parse org_tasks dictionary for tasks and perform them
Parse org_tasks dictionary for tasks and perform them
def performDeckOrgActions():
    """Parse org_tasks dictionary for tasks and perform them"""
    returncodes = []

    mw.checkpoint("Deck Organization Tasks")
    
    for task in org_tasks:
        
        action = task.get("action", "move")

        try:
            assert action in VALID_ACTIONS
        except AssertionError:
            print("Invalid task. Skipping")
            returncodes.append("invalid")
            continue

        ret = moveCardsAction(task)
        if ret:
            returncodes.append(ret)

    mw.reset()

    msg = ["Deck organization tasks complete."]
    if "invalid" in returncodes:
        msg.append("Warning: Your task dictionary contained invalid"
            " tasks that had to be skipped.")
    if "dynamic" in returncodes:
        msg.append("Warning: Some of your decks are filtered decks."
            "<br>Moving cards into filtered decks is not supported")
    if "nocids" in returncodes:
        msg.append("Warning: Some of the origin decks did not contain"
            "any transferable cards.<br>Actions were skipped in those"
            " instances.")
    
    info = "<br><br>".join(msg)
    tooltip(info)
def performDeckOrgActions ( ) : returncodes = [ ] mw . checkpoint ( "Deck Organization Tasks" ) for task in org_tasks : action = task . get ( "action" , "move" ) try : assert action in VALID_ACTIONS except AssertionError : print ( "Invalid task. Skipping" ) returncodes . append ( "invalid" ) continue ret = moveCardsAction ( task ) if ret : returncodes . append ( ret ) mw . reset ( ) msg = [ "Deck organization tasks complete." ] if "invalid" in returncodes : msg . append ( "Warning: Your task dictionary contained invalid" " tasks that had to be skipped." ) if "dynamic" in returncodes : msg . append ( "Warning: Some of your decks are filtered decks." "<br>Moving cards into filtered decks is not supported" ) if "nocids" in returncodes : msg . append ( "Warning: Some of the origin decks did not contain" "any transferable cards.<br>Actions were skipped in those" " instances." ) info = "<br><br>" . join ( msg ) tooltip ( info )