Advertisement
the-technoholik

Blocking Garage Door

Nov 8th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. from my_garage_door_implementation import *
  5. from garage_door_monitor import GarageDoorMonitor
  6.  
  7.  
  8. import time
  9.  
  10. class WaitingGarage(MyGarageDoorImplementation):
  11.     def __init__(self):
  12.         MyGarageDoorImplementation.__init__(self)
  13.  
  14.     def open(self):
  15.         ret = super(WaitingGarage, self).open()
  16.         time.sleep(20)
  17.         return ret
  18.  
  19.     def close(self):
  20.         ret = super(WaitingGarage, self).close()
  21.         time.sleep(20)
  22.         return ret
  23.  
  24. garage = WaitingGarage()
  25.  
  26. openMethod = garage.open
  27. closeMethod = garage.close
  28.  
  29. gdm = GarageDoorMonitor(openMethod, closeMethod)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement