12345678910111213141516171819202122 |
- from neurons import Neurone
- import time
- class NoSecondsException(Exception):
- pass
- class Sleep(Neurone):
- def __init__(self, *args , **kwargs):
- Neurone.__init__(self)
- # get message to spell out loud
- seconds = kwargs.get('seconds', None)
- # user must specify a message
- if seconds is None:
- raise NoSecondsException("You must set a number of seconds as parameter")
- time.sleep(seconds)
|