callback.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #============================================================================
  2. # This file is part of Pwman3.
  3. #
  4. # Pwman3 is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License, version 2
  6. # as published by the Free Software Foundation;
  7. #
  8. # Pwman3 is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with Pwman3; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. #============================================================================
  17. # Copyright (C) 2012 Oz Nahum <nahumoz@gmail.com>
  18. #============================================================================
  19. #============================================================================
  20. # Copyright (C) 2006 Ivan Kelly <ivan@ivankelly.net>
  21. #============================================================================
  22. """
  23. Callback interface
  24. To be used when UI needs to be back to get info from user.
  25. """
  26. # this class is just a base class no real method to test
  27. class Callback(object): # pragma: no cover
  28. """Callback interface. Callback classes must implement this."""
  29. def getinput(self, question):
  30. """Return text"""
  31. pass
  32. def getsecret(self, question):
  33. """Return key"""
  34. pass
  35. def error(self, error):
  36. """Present error to user"""
  37. pass
  38. def warning(self, warning):
  39. """Present warning to user"""
  40. pass
  41. def notice(self, warning):
  42. """Present notice to user"""
  43. pass