Deletes a node

def cmd_delete(args):
    """Deletes a node"""
    major = args.get(0)
    minor = args.get(1)
    if major is not None:
        if major in penStore.data:
            if minor is None:
                if len(penStore.data[major]) > 0:
                    if raw_input("are you sure (y/n)? ") not in ['y', 'Y', 'yes', 'Yes']:
                        return ExitStatus.ABORT
                penStore.deleteList(major)
                puts("list deleted")
            elif minor in penStore.data[major]:
                penStore.deleteNote(major, minor)
                puts("note deleted")
            else:
                puts("no such note, sorry! (%s)" % minor)
        else:
            puts("no such list, sorry! (%s)" % major)
    else:
        print """
- pen: delete help ------------------------------------------------------------

pen delete <list>                 deletes list and all of its notes
pen delete <list> <note>          deletes note
"""