Skip to content

Instantly share code, notes, and snippets.

@lyrixx
Created May 29, 2012 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyrixx/2828098 to your computer and use it in GitHub Desktop.
Save lyrixx/2828098 to your computer and use it in GitHub Desktop.
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