Skip to content

Instantly share code, notes, and snippets.

@lyrixx
Created May 29, 2012
Embed
What would you like to do?
Fabfile, promp with a list
i = 0
for dump in dumps:
print cyan('%(i)s => %(dump)s' % {'i':i, 'dump':dump})
i += 1
def validateDumpNumber(arg):
if i < int(arg):
raise Exception('You have to choose an int among [0-%(i)s], not %(arg)s' % {'i':i, 'arg':arg})
return arg
dumpChoosen = prompt(cyan('{Dump} Choose a dump to restore'), validate=validateDumpNumber, default=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment