123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- """
- Callback interface
- To be used when UI needs to be back to get info from user.
- """
- import getpass
- class Callback(object):
- """Callback interface. Callback classes must implement this."""
- def getinput(self, question):
- """Return text"""
- pass
- def getsecret(self, question):
- """Return key"""
- pass
- def error(self, error):
- """Present error to user"""
- pass
- def warning(self, warning):
- """Present warning to user"""
- pass
- def notice(self, warning):
- """Present notice to user"""
- pass
- class CLICallback(Callback):
- def getinput(self, question):
- return raw_input(question)
- def getsecret(self, question):
- return getpass.getpass(question + ":")
- def getnewsecret(self, question):
- return getpass.getpass(question + ":")
|